aboutsummaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authormurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-11 21:30:03 +0000
committermurf <murf@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-11 21:30:03 +0000
commit0d42de398c741a718a2c7db09f94bc7c29e885a5 (patch)
tree00bb9403a9ec1fe8ecf69c9e6eae118a8d5e93e1 /utils
parent2763c6a1a7ae11a292fcb73d4d247d45454b5765 (diff)
added a -q for quiet, option to aelparse
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@39543 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'utils')
-rw-r--r--utils/ael_main.c49
1 files changed, 30 insertions, 19 deletions
diff --git a/utils/ael_main.c b/utils/ael_main.c
index b93e0ef32..b930ad56b 100644
--- a/utils/ael_main.c
+++ b/utils/ael_main.c
@@ -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, ".");
}