summaryrefslogtreecommitdiffstats
path: root/login-utils/last.c
diff options
context:
space:
mode:
authorKarel Zak2016-12-19 13:13:34 +0100
committerKarel Zak2016-12-19 13:13:34 +0100
commit677ec86cef983a106c6e5d175f44b125858c3016 (patch)
treeb993641faa65700acd62768da189a103da4c40ec /login-utils/last.c
parentinclude/c.h: add errtryhelp() (diff)
downloadkernel-qcow2-util-linux-677ec86cef983a106c6e5d175f44b125858c3016.tar.gz
kernel-qcow2-util-linux-677ec86cef983a106c6e5d175f44b125858c3016.tar.xz
kernel-qcow2-util-linux-677ec86cef983a106c6e5d175f44b125858c3016.zip
Use --help suggestion on invalid option
The current default is to print all usage() output. This is overkill in many case. Addresses: https://github.com/karelzak/util-linux/issues/338 Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'login-utils/last.c')
-rw-r--r--login-utils/last.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/login-utils/last.c b/login-utils/last.c
index 75eff5b94..7c243f147 100644
--- a/login-utils/last.c
+++ b/login-utils/last.c
@@ -1002,8 +1002,7 @@ int main(int argc, char **argv)
ctl.time_fmt = which_time_format(optarg);
break;
default:
- usage(&ctl, stderr);
- break;
+ errtryhelp(EXIT_FAILURE);
}
}