5904a5905,5907 > #define FORMAT_STRING " %20s@%-20.20s: %-20.20s State:%-15.15s Watchers %2d\n" > #define CONCISE_FORMAT_STRING "%s!%s!%s!%s!%d\n" > 5906c5909 < int num = 0; --- > int num = 0, concise = 0; 5912c5915 < e->command = "core show hints"; --- > e->command = "core show hints [concise]"; 5914,5915c5917,5920 < "Usage: core show hints\n" < " List registered hints\n"; --- > "Usage: core show hints [concise]\n" > " List registered hints. If 'concise' is specified,\n" > " the format is abridged and in a more easily machine\n" > " parsable format.\n"; 5920a5926,5934 > > if (a->argc == e->args) { > if (!strcasecmp(a->argv[e->args-1],"concise")) > concise = 1; > else > return CLI_SHOWUSAGE; > } else if (a->argc != e->args - 1) > return CLI_SHOWUSAGE; > 5937,5941c5951,5963 < ast_cli(a->fd, " %20s@%-20.20s: %-20.20s State:%-15.15s Watchers %2d\n", < ast_get_extension_name(hint->exten), < ast_get_context_name(ast_get_extension_context(hint->exten)), < ast_get_extension_app(hint->exten), < ast_extension_state2str(hint->laststate), watchers); --- > if (concise) { > ast_cli(a->fd, CONCISE_FORMAT_STRING, > ast_get_extension_name(hint->exten), > ast_get_context_name(ast_get_extension_context(hint->exten)), > ast_get_extension_app(hint->exten), > ast_extension_state2str(hint->laststate), watchers); > } else { > ast_cli(a->fd, FORMAT_STRING, > ast_get_extension_name(hint->exten), > ast_get_context_name(ast_get_extension_context(hint->exten)), > ast_get_extension_app(hint->exten), > ast_extension_state2str(hint->laststate), watchers); > } 5949a5972,5973 > #undef FORMAT_STRING > #undef CONCISE_FORMAT_STRING