Skip to content

Commit 6010b9f

Browse files
classabbyampDuncaen
authored andcommitted
bin/xbps-uhelper: add longopts for -CdrV
also adjust help output to be more clear, and removed examples (moving those to the manpage)
1 parent a5cb441 commit 6010b9f

1 file changed

Lines changed: 22 additions & 28 deletions

File tree

bin/xbps-uhelper/main.c

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -44,40 +44,30 @@ usage(void)
4444
"usage: xbps-uhelper [options] [action] [args]\n"
4545
"\n"
4646
" Available actions:\n"
47-
" binpkgarch, binpkgver, cmpver, fetch, getpkgdepname,\n"
47+
" binpkgarch, binpkgver, cmpver, getpkgdepname,\n"
4848
" getpkgname, getpkgrevision, getpkgversion, pkgmatch, version,\n"
4949
" real-version, arch, getsystemdir, getname, getversion\n"
5050
"\n"
5151
" Action arguments:\n"
52-
" binpkgarch\t<binpkg> ...\n"
53-
" binpkgver\t<binpkg> ...\n"
54-
" cmpver\t\t<instver> <reqver>\n"
55-
" getpkgdepname\t<string> ...\n"
56-
" getpkgdepversion\t<string> ...\n"
57-
" getpkgname\t\t<string> ...\n"
58-
" getpkgrevision\t<string> ...\n"
59-
" getpkgversion\t<string> ...\n"
60-
" getname\t\t<string> ...\n"
61-
" getversion\t\t<string> ...\n"
62-
" pkgmatch\t\t<pkg-version> <pkg-pattern>\n"
63-
" version\t\t<pkgname> ...\n"
64-
" real-version\t<pkgname> ...\n"
52+
" binpkgarch <binpkg> ...\n"
53+
" binpkgver <binpkg> ...\n"
54+
" cmpver <instver> <reqver>\n"
55+
" getpkgdepname <string> ...\n"
56+
" getpkgdepversion <string> ...\n"
57+
" getpkgname <string> ...\n"
58+
" getpkgrevision <string> ...\n"
59+
" getpkgversion <string> ...\n"
60+
" getname <string> ...\n"
61+
" getversion <string> ...\n"
62+
" pkgmatch <pkg-version> <pkg-pattern>\n"
63+
" version <pkgname> ...\n"
64+
" real-version <pkgname> ...\n"
6565
"\n"
6666
" Options shared by all actions:\n"
67-
" -C\t\tPath to xbps.conf file.\n"
68-
" -d\t\tDebugging messages to stderr.\n"
69-
" -r\t\t<rootdir>\n"
70-
" -V\t\tPrints the xbps release version\n"
71-
"\n"
72-
" Examples:\n"
73-
" $ xbps-uhelper cmpver 'foo-1.0_1' 'foo-2.1_1'\n"
74-
" $ xbps-uhelper getpkgdepname 'foo>=0'\n"
75-
" $ xbps-uhelper getpkgdepversion 'foo>=0'\n"
76-
" $ xbps-uhelper getpkgname foo-2.0_1\n"
77-
" $ xbps-uhelper getpkgrevision foo-2.0_1\n"
78-
" $ xbps-uhelper getpkgversion foo-2.0_1\n"
79-
" $ xbps-uhelper pkgmatch foo-1.0_1 'foo>=1.0'\n"
80-
" $ xbps-uhelper version pkgname\n");
67+
" -C, --config Path to xbps.conf file.\n"
68+
" -d, --debug Debugging messages to stderr.\n"
69+
" -r, --rootdir <rootdir>\n"
70+
" -V, --version Prints the xbps release version\n");
8171

8272
exit(EXIT_FAILURE);
8373
}
@@ -107,6 +97,10 @@ main(int argc, char **argv)
10797
char pkgname[XBPS_NAME_SIZE], *filename;
10898
int flags = 0, c, rv = 0, i = 0;
10999
const struct option longopts[] = {
100+
{ "config", required_argument, NULL, 'C' },
101+
{ "debug", no_argument, NULL, 'd' },
102+
{ "rootdir", required_argument, NULL, 'r' },
103+
{ "version", no_argument, NULL, 'V' },
110104
{ NULL, 0, NULL, 0 }
111105
};
112106

0 commit comments

Comments
 (0)