added a -q for quiet, option to aelparse

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39543 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Steve Murphy
2006-08-11 21:30:03 +00:00
parent 2ec3a672e9
commit 1d2b76a0f8
13 changed files with 158 additions and 183 deletions

View File

@@ -99,6 +99,7 @@ void ast_verbose(const char *fmt, ...);
struct ast_app *pbx_findapp(const char *app);
void filter_leading_space_from_exprs(char *str);
void filter_newlines(char *str);
static int quiet = 0;
static int no_comp = 0;
static int use_curr_dir = 0;
static int dump_extensions = 0;
@@ -119,19 +120,21 @@ void ast_add_profile(void)
void ast_cli_register_multiple(void)
{
if(!no_comp)
printf("Executed ast_cli_register_multiple();\n");
printf("Executed ast_cli_register_multiple();\n");
}
void ast_register_file_version(void)
{
if(!no_comp)
printf("Executed ast_register_file_version();\n");
/* if(!no_comp)
printf("Executed ast_register_file_version();\n"); */
/* I'm erasing this, because I don't think anyone really ever needs to see it anyway */
}
void ast_unregister_file_version(void)
{
if(!no_comp)
printf("Executed ast_unregister_file_version();\n");
/* if(!no_comp)
printf("Executed ast_unregister_file_version();\n"); */
/* I'm erasing this, because I don't think anyone really ever needs to see it anyway */
}
int ast_add_extension2(struct ast_context *con,
@@ -309,19 +312,21 @@ void ast_cli_unregister_multiple(void)
void ast_context_destroy(void)
{
printf("Executed ast_context_destroy();\n");
if( !no_comp)
printf("Executed ast_context_destroy();\n");
}
void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
{
va_list vars;
va_start(vars,fmt);
printf("LOG: lev:%d file:%s line:%d func: %s ",
if( !quiet || level > 2 ) {
printf("LOG: lev:%d file:%s line:%d func: %s ",
level, file, line, function);
vprintf(fmt, vars);
fflush(stdout);
va_end(vars);
vprintf(fmt, vars);
fflush(stdout);
va_end(vars);
}
}
void ast_verbose(const char *fmt, ...)
@@ -409,20 +414,26 @@ int main(int argc, char **argv)
for(i=1;i<argc;i++) {
if( argv[i][0] == '-' && argv[i][1] == 'n' )
no_comp =1;
if( argv[i][0] == '-' && argv[i][1] == 'q' ) {
quiet = 1;
no_comp =1;
}
if( argv[i][0] == '-' && argv[i][1] == 'd' )
use_curr_dir =1;
if( argv[i][0] == '-' && argv[i][1] == 'w' )
dump_extensions =1;
}
if( !no_comp )
printf("\n(You can use the -n option if you aren't interested in seeing all the instructions generated by the compiler)\n\n");
if( !use_curr_dir )
printf("\n(You can use the -d option if you want to use the current working directory as the CONFIG_DIR. I will look in this dir for extensions.ael* and its included files)\n\n");
if( !dump_extensions )
printf("\n(You can use the -w option to dump extensions.conf format to extensions.conf.aeldump)\n");
if( !quiet ) {
printf("\n(If you find progress and other non-error messages irritating, you can use -q to suppress them)\n");
if( !no_comp )
printf("\n(You can use the -n option if you aren't interested in seeing all the instructions generated by the compiler)\n\n");
if( !use_curr_dir )
printf("\n(You can use the -d option if you want to use the current working directory as the CONFIG_DIR. I will look in this dir for extensions.ael* and its included files)\n\n");
if( !dump_extensions )
printf("\n(You can use the -w option to dump extensions.conf format to extensions.conf.aeldump)\n");
}
if( use_curr_dir ) {
strcpy(ast_config_AST_CONFIG_DIR, ".");
}