summaryrefslogtreecommitdiffstats
path: root/src/tools/common
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2016-06-01 14:38:11 +0200
committerJakub Hrozek <jhrozek@redhat.com>2016-06-27 16:34:57 +0200
commitcf3ba77997dfbd076a1f30fdbb33c7973766ac03 (patch)
treea245c257bdb86a869daa8b618e993f4afe2190ae /src/tools/common
parent36e262020c80479baa09b2c4c8dd045c7a0f32a1 (diff)
downloadsssd-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.c7
-rw-r--r--src/tools/common/sss_tools.h3
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;
};