]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
hwclock: use errtryhelp()
authorJ William Piggott <elseifthen@gmx.com>
Mon, 10 Apr 2017 17:39:49 +0000 (13:39 -0400)
committerJ William Piggott <elseifthen@gmx.com>
Mon, 10 Apr 2017 18:22:30 +0000 (14:22 -0400)
* sys-utils/hwclock.c: use errtryhelp() instead of usage().

Signed-off-by: J William Piggott <elseifthen@gmx.com>
sys-utils/hwclock.c

index 3875bcc547ec3f50b21b891de120a3284d673bf4..a99eb6d602b26dfadda401c059ec1356c1d1206c 100644 (file)
@@ -1479,9 +1479,9 @@ int main(int argc, char **argv)
                        out_version();
                        return 0;
                case 'h':                       /* --help */
-               case '?':
-               default:
                        usage(&ctl, NULL);
+               default:
+                       errtryhelp(EXIT_FAILURE);
                }
        }
 
@@ -1497,9 +1497,8 @@ int main(int argc, char **argv)
        }
 #endif
        if (argc > 0) {
-               usage(&ctl, _("%s takes no non-option arguments.  "
-                       "You supplied %d.\n"), program_invocation_short_name,
-                     argc);
+               warnx(_("%d too many arguments given"), argc);
+               errtryhelp(EXIT_FAILURE);
        }
 
        if (!ctl.adj_file_name)