X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmain.c;h=7da2a99d46452f7e614875b51ece887249b166ef;hb=1ab818de1d890bf716413090d943858bfef8d3d3;hp=ad0c17f7ef9892dfdcf717fe1f3f459fc82e8ae7;hpb=d83f67398f1bf3c1f1372570c009071622626e4e;p=lttv.git diff --git a/ltt/branches/poly/lttv/main.c b/ltt/branches/poly/lttv/main.c index ad0c17f7..7da2a99d 100644 --- a/ltt/branches/poly/lttv/main.c +++ b/ltt/branches/poly/lttv/main.c @@ -7,6 +7,8 @@ #include #include #include +#include + void lttv_option_init(int argc, char **argv); void lttv_option_destroy(); @@ -41,10 +43,7 @@ static void lttv_module_option(void *hook_data); static void lttv_module_path_option(void *hook_data); -#ifdef MEMDEBUG -extern struct GMemVTable *glib_mem_profiler_table; -#endif - +static void lttv_help(void); /* Since everything is done in modules, the main program only takes care of the infrastructure. */ @@ -59,8 +58,8 @@ int main(int argc, char **argv) { g_mem_profile(); #endif - //g_type_init(); - g_type_init_with_debug_flags (G_TYPE_DEBUG_OBJECTS | G_TYPE_DEBUG_SIGNALS); + g_type_init(); + //g_type_init_with_debug_flags (G_TYPE_DEBUG_OBJECTS | G_TYPE_DEBUG_SIGNALS); attributes = LTTV_IATTRIBUTE(g_object_new(LTTV_ATTRIBUTE_TYPE, NULL)); @@ -102,7 +101,11 @@ int main(int argc, char **argv) { "add a directory to the module search path", "directory to add to the path", LTTV_OPT_STRING, &a_module_path, lttv_module_path_option, NULL); - + + lttv_option_add("help",'h', "basic help", "none", + LTTV_OPT_NONE, NULL, lttv_help, NULL); + + lttv_hooks_call(before_options, NULL); lttv_option_parse(argc, argv); lttv_hooks_call(after_options, NULL); @@ -143,3 +146,11 @@ void lttv_module_path_option(void *hook_data) { lttv_module_path_add(a_module_path); } + +void lttv_help() +{ + printf("Linux Trace Toolkit Visualizer\n"); + printf("\n"); + lttv_option_show_help(); + printf("\n"); +}