From: Karel Zak Date: Tue, 13 Dec 2022 15:41:34 +0000 (+0100) Subject: chfn: use -V for version X-Git-Tag: v2.39-rc1~370 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0222a2ca0589fdf1a32fe114d0cd9c54617dbf18;p=thirdparty%2Futil-linux.git chfn: use -V for version Let's use more compatible -V for --version and mark -v as deprecated. Addresses: https://github.com/util-linux/util-linux/pull/1954 Signed-off-by: Karel Zak --- diff --git a/login-utils/chfn.1.adoc b/login-utils/chfn.1.adoc index 6377e2644b..35a2e82cf0 100644 --- a/login-utils/chfn.1.adoc +++ b/login-utils/chfn.1.adoc @@ -20,7 +20,7 @@ chfn - change your finger information == SYNOPSIS -*chfn* [*-f* _full-name_] [*-o* _office_] [*-p* _office-phone_] [*-h* _home-phone_] [*-u*] [*-v*] [_username_] +*chfn* [*-f* _full-name_] [*-o* _office_] [*-p* _office-phone_] [*-h* _home-phone_] [*-u*] [*-V*] [_username_] == DESCRIPTION @@ -46,6 +46,13 @@ Specify your office phone number. *-h*, *--home-phone* _home-phone_:: Specify your home phone number. +*-u*, *--help*:: +Display help text and exit. + +*-V*, *--version*:: +Print version and exit. The short options *-V* have been used since version 2.39; old versions use +deprecated *-v*. + include::man-common/help-version.adoc[] == CONFIG FILE ITEMS diff --git a/login-utils/chfn.c b/login-utils/chfn.c index 8f00d156e3..752d59821f 100644 --- a/login-utils/chfn.c +++ b/login-utils/chfn.c @@ -100,7 +100,7 @@ static void __attribute__((__noreturn__)) usage(void) fputs(_(" -h, --home-phone home phone number\n"), fp); fputs(USAGE_SEPARATOR, fp); printf( " -u, --help %s\n", USAGE_OPTSTR_HELP); - printf( " -v, --version %s\n", USAGE_OPTSTR_VERSION); + printf( " -V, --version %s\n", USAGE_OPTSTR_VERSION); printf(USAGE_MAN_TAIL("chfn(1)")); exit(EXIT_SUCCESS); } @@ -139,11 +139,11 @@ static void parse_argv(struct chfn_control *ctl, int argc, char **argv) { "office-phone", required_argument, NULL, 'p' }, { "home-phone", required_argument, NULL, 'h' }, { "help", no_argument, NULL, 'u' }, - { "version", no_argument, NULL, 'v' }, + { "version", no_argument, NULL, 'V' }, { NULL, 0, NULL, 0 }, }; - while ((c = getopt_long(argc, argv, "f:r:p:h:o:uv", long_options, + while ((c = getopt_long(argc, argv, "f:r:p:h:o:uvV", long_options, &index)) != -1) { switch (c) { case 'f': @@ -170,7 +170,8 @@ static void parse_argv(struct chfn_control *ctl, int argc, char **argv) ctl->newf.home_phone = optarg; status += check_gecos_string(_("Home Phone"), optarg); break; - case 'v': + case 'v': /* deprecated */ + case 'V': print_version(EXIT_SUCCESS); case 'u': usage();