Skip to content

Commit

Permalink
user services flag
Browse files Browse the repository at this point in the history
  • Loading branch information
navi-desu committed Sep 21, 2024
1 parent 995ef05 commit d7d09aa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/shared/_usage.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,33 @@

#include <getopt.h>
#include <stdlib.h>
#include "librc.h"

#define getoptstring_COMMON "ChqVv"
#define getoptstring_COMMON "ChqVvU"

#define longopts_COMMON \
{ "help", 0, NULL, 'h'}, \
{ "nocolor", 0, NULL, 'C'}, \
{ "version", 0, NULL, 'V'}, \
{ "verbose", 0, NULL, 'v'}, \
{ "quiet", 0, NULL, 'q'}, \
{ "user", 0, NULL, 'U'}, \
{ NULL, 0, NULL, 0 }

#define longopts_help_COMMON \
"Display this help output", \
"Disable color output", \
"Display software version", \
"Run verbosely", \
"Run quietly (repeat to suppress errors)"
"Run quietly (repeat to suppress errors)" \
"Run in user mode"

#define case_RC_COMMON_getopt_case_C setenv ("EINFO_COLOR", "NO", 1);
#define case_RC_COMMON_getopt_case_h usage (EXIT_SUCCESS);
#define case_RC_COMMON_getopt_case_V if (argc == 2) show_version();
#define case_RC_COMMON_getopt_case_v setenv ("EINFO_VERBOSE", "YES", 1);
#define case_RC_COMMON_getopt_case_q set_quiet_options();
#define case_RC_COMMON_getopt_case_U rc_set_user();
#define case_RC_COMMON_getopt_default usage (EXIT_FAILURE);

#define case_RC_COMMON_GETOPT \
Expand All @@ -43,6 +47,7 @@
case 'V': case_RC_COMMON_getopt_case_V; break; \
case 'v': case_RC_COMMON_getopt_case_v; break; \
case 'q': case_RC_COMMON_getopt_case_q; break; \
case 'U': case_RC_COMMON_getopt_case_U; break; \
default: case_RC_COMMON_getopt_default; break;

extern const char *applet;
Expand Down

0 comments on commit d7d09aa

Please sign in to comment.