diff --git a/libs/esl/perl/logger.pl b/libs/esl/perl/logger.pl index 2e26cfdb69..59e1373b68 100644 --- a/libs/esl/perl/logger.pl +++ b/libs/esl/perl/logger.pl @@ -13,6 +13,21 @@ my $e; my $running = 1; my $con; +my $USAGE = " +FreeSWITCH Logger Utility + +USAGE: +-h --helpThis help +-p --port Choose port +-P -pass Choose password +-f --file Output file +-pb --paste-bin Post to FreeSWITCH Paste Bin +-sp --sip-profiles List of SIP profiles to trace +-sd --sip-debug Set SIP debug level + +No arguments given will trace profile 'internal' to STDOUT +"; + $SIG{INT} = sub { $running = 0 }; sub parse(\$\$$) { @@ -27,6 +42,11 @@ sub parse(\$\$$) { } for($i = 0; $i < $argc; $i++) { + if ($ARGV[$i] =~ /^\-help$|^\-\-help$/) { + print $USAGE; + exit; + } + if (! (parse($i, $host, '^-h$|^--host$') || parse($i, $port, '^-p$|^--port$') || parse($i, $pass, '^-P$|^--pass$') ||