mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
client: add long options for --verbose and --help
This commit is contained in:
parent
8b4ef78f7a
commit
77ea7fc61c
1 changed files with 7 additions and 1 deletions
8
client.c
8
client.c
|
|
@ -40,8 +40,14 @@ main(int argc, char *const *argv)
|
||||||
|
|
||||||
const char *const prog_name = argv[0];
|
const char *const prog_name = argv[0];
|
||||||
|
|
||||||
|
static const struct option longopts[] = {
|
||||||
|
{"version", no_argument, 0, 'v'},
|
||||||
|
{"help", no_argument, 0, 'h'},
|
||||||
|
{NULL, no_argument, 0, 0},
|
||||||
|
};
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
int c = getopt_long(argc, argv, ":hv", NULL, NULL);
|
int c = getopt_long(argc, argv, ":hv", longopts, NULL);
|
||||||
if (c == -1)
|
if (c == -1)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue