about summary refs log tree commit diff
path: root/lr.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-10-23 18:42:39 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2015-10-23 18:42:39 +0200
commit079548a80175869c791b5401d6ecc04ec042c763 (patch)
treea5917c4f9931cc7e465427977d8870b1dbb212c0 /lr.c
parent2e9e073cc85b521203d7a94b1457d55e4a0d0689 (diff)
downloadlr-079548a80175869c791b5401d6ecc04ec042c763.tar.gz
lr-079548a80175869c791b5401d6ecc04ec042c763.tar.xz
lr-079548a80175869c791b5401d6ecc04ec042c763.zip
sort by inode
Diffstat (limited to 'lr.c')
-rw-r--r--lr.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lr.c b/lr.c
index d718efb..e786495 100644
--- a/lr.c
+++ b/lr.c
@@ -648,6 +648,8 @@ order(const void *a, const void *b)
 		case 'M': CMP(fb->sb.st_mtime, fa->sb.st_mtime);
 		case 's': CMP(fa->sb.st_size, fb->sb.st_size);
 		case 'S': CMP(fb->sb.st_size, fa->sb.st_size);
+		case 'i': CMP(fa->sb.st_ino, fb->sb.st_ino);
+		case 'I': CMP(fb->sb.st_ino, fa->sb.st_ino);
 		case 'd': CMP(fa->depth, fb->depth);
 		case 'D': CMP(fb->depth, fa->depth);
 		case 'n': STRCMP(fa->fpath, fb->fpath);
@@ -779,6 +781,12 @@ print(const void *nodep, const VISIT which, const int depth)
 				case 'd': printf("%d", fi->depth); break;
 				case 'D': printf("%ld", fi->sb.st_dev); break;
 				case 'i': printf("%ld", fi->sb.st_ino); break;
+				case 'I':
+					{
+					int i;
+					for (i=0; i<fi->depth; i++) printf(" ");
+					}
+					break;
 				case 'p': printf("%s",
 					    sflag && strncmp(fi->fpath, "./", 2) == 0 ?
 					    fi->fpath+2 : fi->fpath);
@@ -1030,7 +1038,7 @@ main(int argc, char *argv[])
 		case 't': expr = chain(expr, EXPR_AND, parse_expr(optarg)); break;
 		case 'x': xflag++; break;
 		default:
-			fprintf(stderr, "Usage: %s [-0|-F|-l|-f FMT] [-D] [-H|-L] [-1dx] [-U|-o ORD] [-t TEST]* PATH...\n", argv0);
+			fprintf(stderr, "Usage: %s [-0|-F|-l|-f FMT] [-D] [-H|-L] [-1dsx] [-U|-o ORD] [-t TEST]* PATH...\n", argv0);
 			exit(2);
 		}