From: Rutger van Bergen Date: Wed, 22 Dec 2021 17:20:05 +0000 (+0100) Subject: Add short options X-Git-Tag: v1.1~10 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=1383ce852dfc0c85de03e8e0ab838090b7fcd679;p=minsk.git Add short options --- diff --git a/minsk.c b/minsk.c index 669492a..419ce0d 100644 --- a/minsk.c +++ b/minsk.c @@ -1297,16 +1297,16 @@ static void usage(void) fprintf(stderr, "Options:\n\n"); #ifdef ENABLE_DAEMON_MODE fprintf(stderr, "\ ---daemon Run as daemon and listen for network connections\n\ ---nofork When run with --daemon, avoid forking\n\ +-d, --daemon Run as daemon and listen for network connections\n\ +-n, --nofork When run with --daemon, avoid forking\n\ "); #endif fprintf(stderr, "\ ---english Print messages in English\n\ ---set-password Put hidden password in memory\n\ ---trace= Enable tracing of program execution\n\ ---cpu-quota= Set CPU quota to instructions\n\ ---print-quota= Set printer quota to lines\n\ +-e, --english Print messages in English\n\ +-s, --set-password Put hidden password in memory\n\ +-t, --trace= Enable tracing of program execution\n\ +-q, --cpu-quota= Set CPU quota to instructions\n\ +-p, --print-quota= Set printer quota to lines\n\ "); exit(1); } @@ -1318,7 +1318,7 @@ int main(int argc, char **argv) int do_fork = 1; int set_password = 0; - while ((opt = getopt_long(argc, argv, "", longopts, NULL)) >= 0) + while ((opt = getopt_long(argc, argv, "q:desnp:t:", longopts, NULL)) >= 0) switch (opt) { case 'd':