Skip to content

Commit

Permalink
UTILS: Create a macro for the --config option
Browse files Browse the repository at this point in the history
Other common options already have their macro. I'm
creating the macro SSS_CONFIG_OPTS for this one.
  • Loading branch information
aplopez committed Sep 27, 2023
1 parent 01bee47 commit 5346f5b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/monitor/monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -2001,15 +2001,14 @@ int main(int argc, const char *argv[])
POPT_AUTOHELP
SSSD_MAIN_OPTS
SSSD_LOGGER_OPTS
SSSD_CONFIG_OPTS(opt_config_file)
{"daemon", 'D', POPT_ARG_NONE, &opt_daemon, 0, \
_("Become a daemon (default)"), NULL }, \
{"interactive", 'i', POPT_ARG_NONE, &opt_interactive, 0, \
_("Run interactive (not a daemon)"), NULL}, \
{"disable-netlink", '\0', POPT_ARG_NONE | POPT_ARGFLAG_DOC_HIDDEN,
&opt_netlinkoff, 0, \
_("Disable netlink interface"), NULL}, \
{"config", 'c', POPT_ARG_STRING, &opt_config_file, 0, \
_("Specify a non-default config file"), NULL}, \
{"genconf", 'g', POPT_ARG_NONE, &opt_genconf, 0, \
_("Refresh the configuration database, then exit"), \
NULL}, \
Expand Down
3 changes: 1 addition & 2 deletions src/tools/sssctl/sssctl_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ errno_t sssctl_config_check(struct sss_cmdline *cmdline,
const char *config_path = NULL;
const char *config_snippet_path = NULL;
struct poptOption long_options[] = {
{"config", 'c', POPT_ARG_STRING, &config_path,
0, _("Specify a non-default config file"), NULL},
SSSD_CONFIG_OPTS(config_path)
{"snippet", 's', POPT_ARG_STRING, &config_snippet_path,
0, _("Specify a non-default snippet dir (The default is to look in "
"the same place where the main config file is located. For "
Expand Down
4 changes: 4 additions & 0 deletions src/util/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@
{"gid", 0, POPT_ARG_INT, &gid, 0, \
_("The group ID to run the server as"), NULL},

#define SSSD_CONFIG_OPTS(opt_config_file) \
{"config", 'c', POPT_ARG_STRING, &opt_config_file, 0, \
_("Specify a non-default config file"), NULL}, \

extern int socket_activated;

#ifdef HAVE_SYSTEMD
Expand Down

0 comments on commit 5346f5b

Please sign in to comment.