X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Foption.c;h=01237acb2e62b67446c8b8ecb582d456c9b8fd7f;hb=558aa01322f1af8be09fcfc086864da0373823c5;hp=4c45d2ab97d21cbd19ab1b0c13ca63750cc3d78b;hpb=ffd54a901f0062e31ffb35a316de9d8b17104abb;p=lttv.git diff --git a/ltt/branches/poly/lttv/option.c b/ltt/branches/poly/lttv/option.c index 4c45d2ab..01237acb 100644 --- a/ltt/branches/poly/lttv/option.c +++ b/ltt/branches/poly/lttv/option.c @@ -215,3 +215,32 @@ void lttv_option_parse(int argc, char **argv) destroy_popts(&list, &popts, &c); } +static void show_help(LttvOption *option) +{ + printf("--%s -%c argument: %s\n" , option->long_name, + option->char_name, + option->arg_description); + printf(" %s\n" , option->description); + +} + +void lttv_option_show_help(void) +{ + LttvOption option; + + GPtrArray *list = g_ptr_array_new(); + + int i; + + g_hash_table_foreach(options, list_options, list); + + printf("Built-in commands available:\n"); + printf("\n"); + + for(i = 0 ; i < list->len ; i++) { + show_help((LttvOption *)list->pdata[i]); + } + g_ptr_array_free(list, TRUE); + + +}