]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fstrim: use -n shortcut for --dry-run
authorKarel Zak <kzak@redhat.com>
Thu, 16 Aug 2018 12:00:45 +0000 (14:00 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 16 Aug 2018 12:00:45 +0000 (14:00 +0200)
It seems 'n' is more common than 'd'. The patch also cleanup
getopt_long() options string.

Addresses: https://github.com/karelzak/util-linux/commit/fda0e2cf043994c77c29a2d109c03ce8957b1d38#commitcomment-30097920
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/fstrim.8
sys-utils/fstrim.c

index 4e052a546a2142fdf52a23168f17c513da2ad5d8..ff572a44b2fe1f9c0dd5789457846d4ad43caeb6 100644 (file)
@@ -60,7 +60,7 @@ The other supplied options, like \fB\-\-offset\fR, \fB\-\-length\fR and
 \fB-\-minimum\fR, are applied to all these devices.
 Errors from filesystems that do not support the discard operation are silently
 ignored.
-.IP "\fB\-d, \-\-dry\-run\fP"
+.IP "\fB\-n, \-\-dry\-run\fP"
 This option does everything apart from actually call FITRIM ioctl.
 .IP "\fB\-o, \-\-offset\fP \fIoffset\fP"
 Byte offset in the filesystem from which to begin searching for free blocks
index 624ffa3097b0e8a6914e4e68c283f1fff7a05563..b1823f5c5f927df7942f771b42ea8277291871de 100644 (file)
@@ -348,7 +348,7 @@ int main(int argc, char **argv)
            { "length",    required_argument, NULL, 'l' },
            { "minimum",   required_argument, NULL, 'm' },
            { "verbose",   no_argument,       NULL, 'v' },
-           { "dry-run",   no_argument,       NULL, 'd' },
+           { "dry-run",   no_argument,       NULL, 'n' },
            { NULL, 0, NULL, 0 }
        };
 
@@ -357,7 +357,7 @@ int main(int argc, char **argv)
        textdomain(PACKAGE);
        atexit(close_stdout);
 
-       while ((c = getopt_long(argc, argv, "AadhVo:l:m:v", longopts, NULL)) != -1) {
+       while ((c = getopt_long(argc, argv, "Aahl:m:no:Vv", longopts, NULL)) != -1) {
                switch(c) {
                case 'A':
                        ctl.fstab = 1;
@@ -365,7 +365,7 @@ int main(int argc, char **argv)
                case 'a':
                        all = 1;
                        break;
-               case 'd':
+               case 'n':
                        ctl.dryrun = 1;
                        break;
                case 'h':