From 1c54d1361455e6788a9556ad820de676b4512817 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sat, 16 Jul 2011 04:14:58 -0500 Subject: apk: display command descriptions in command list --- src/apk.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/apk.c b/src/apk.c index f0349e4403..3dbab07fe3 100644 --- a/src/apk.c +++ b/src/apk.c @@ -139,23 +139,28 @@ static int usage(struct apk_applet *applet) print_usage("COMMAND", "[ARGS]...", ARRAY_SIZE(generic_options), generic_options); - printf("\navailable commands:\n "); - for (a = &__start_apkapplets; a < &__stop_apkapplets; a++) - printf("%s ", (*a)->name); + printf("\nThe following commands are available:\n"); + for (a = &__start_apkapplets; a < &__stop_apkapplets; a++) { + struct apk_indent sub_indent = { 20, 26 }; + + printf(" %-*s", sub_indent.indent - 3, (*a)->name); + apk_print_indented_words(&sub_indent, (*a)->help); + printf("\n"); + } } else { print_usage(applet->name, applet->arguments, applet->num_options, applet->options); printf("\ndescription:\n%*s", indent.indent - 1, ""); apk_print_indented_words(&indent, applet->help); } - printf("\n\ngeneric options:\n"); + printf("\nGeneric options:\n"); print_options(ARRAY_SIZE(generic_options), generic_options); if (applet != NULL && applet->num_options > 0) { printf("\noptions for %s command:\n", applet->name); print_options(applet->num_options, applet->options); } - printf("\nThis apk has coffee making abilities.\n\n"); + printf("\nThis apk has coffee making abilities.\n"); return 1; } -- cgit v1.2.3