]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
rename: prevent --no-act from setting --no-overwrite
authorG.raud Meyer <graud@gmx.com>
Thu, 29 Mar 2018 10:58:44 +0000 (12:58 +0200)
committerG.raud Meyer <graud@gmx.com>
Thu, 29 Mar 2018 18:35:30 +0000 (20:35 +0200)
This fixes a bug introduced by commit fabb90676 ("Added --no-override
option to rename.", 2017-05-27) where the fallthrough meant to let
--no-act set --verbose was changed to set --no-override (the previous
code was too smart).

Do not let --no-act set --verbose anymore but update the manual to
recommend adding option --verbose.  This is to be able to make --no-act
detect only non existing file arguments (in a future commit).

misc-utils/rename.1
misc-utils/rename.c

index d476d2435fc7988d95b6a52f255a3fccb4562bcc..df329461b49bb24c73272a9d51b82029bcb9119d 100644 (file)
@@ -23,7 +23,9 @@ Do not rename a symlink but its target.
 Show which files were renamed, if any.
 .TP
 .BR \-n , " \-\-no\-act"
-Do not make any changes.
+Do not make any changes; add
+.BR \-\-verbose
+to see what would be made.
 .TP
 .BR \-o , " \-\-no\-overwrite"
 Do not overwrite existing files.  When
index 1d280add37809b8f0f2f417286e2c9c91c800237..147e54fe92f7af21b95f2d45c8c786cc7be331a3 100644 (file)
@@ -174,13 +174,13 @@ int main(int argc, char **argv)
                switch (c) {
                case 'n':
                        noact = 1;
-                       /* fallthrough */
-               case 'o':
-                       nooverwrite = 1;
-                        break;
+                       break;
                case 'v':
                        verbose = 1;
                        break;
+               case 'o':
+                       nooverwrite = 1;
+                       break;
                case 's':
                        do_rename = do_symlink;
                        break;