diff options
| author | Pavel Březina <pbrezina@redhat.com> | 2016-06-01 14:38:11 +0200 |
|---|---|---|
| committer | Jakub Hrozek <jhrozek@redhat.com> | 2016-06-27 16:34:57 +0200 |
| commit | cf3ba77997dfbd076a1f30fdbb33c7973766ac03 (patch) | |
| tree | a245c257bdb86a869daa8b618e993f4afe2190ae /src/tools/common | |
| parent | 36e262020c80479baa09b2c4c8dd045c7a0f32a1 (diff) | |
| download | sssd-cf3ba77997dfbd076a1f30fdbb33c7973766ac03.tar.gz sssd-cf3ba77997dfbd076a1f30fdbb33c7973766ac03.tar.xz sssd-cf3ba77997dfbd076a1f30fdbb33c7973766ac03.zip | |
sss_tools: add command description
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/tools/common')
| -rw-r--r-- | src/tools/common/sss_tools.c | 7 | ||||
| -rw-r--r-- | src/tools/common/sss_tools.h | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/tools/common/sss_tools.c b/src/tools/common/sss_tools.c index b916f772b..a3280066f 100644 --- a/src/tools/common/sss_tools.c +++ b/src/tools/common/sss_tools.c @@ -228,7 +228,12 @@ int sss_tool_usage(const char *tool_name, fprintf(stderr, _("Available commands:\n")); for (i = 0; commands[i].command != NULL; i++) { - fprintf(stderr, "* %s\n", commands[i].command); + if (commands[i].description == NULL) { + fprintf(stderr, "* %s\n", commands[i].command); + } else { + fprintf(stderr, "* %s\t\t %s\n", + commands[i].command, commands[i].description); + } } fprintf(stderr, _("\n")); diff --git a/src/tools/common/sss_tools.h b/src/tools/common/sss_tools.h index cfe11d06e..77a964512 100644 --- a/src/tools/common/sss_tools.h +++ b/src/tools/common/sss_tools.h @@ -43,8 +43,11 @@ typedef int struct sss_tool_ctx *tool_ctx, void *pvt); +#define SSS_TOOL_COMMAND(cmd, msg, fn) {cmd, _(msg), fn} + struct sss_route_cmd { const char *command; + const char *description; sss_route_fn fn; }; |
