diff --git a/bin/netdisco-do b/bin/netdisco-do index 9bf64884..914290e9 100755 --- a/bin/netdisco-do +++ b/bin/netdisco-do @@ -37,8 +37,6 @@ BEGIN { use App::Netdisco; use Dancer qw/:moose :script/; -info "App::Netdisco version $App::Netdisco::VERSION loaded."; - use Try::Tiny; use Pod::Usage; use Scalar::Util 'blessed'; @@ -51,7 +49,7 @@ use App::Netdisco::Util::Device 'get_device'; use Getopt::Long; Getopt::Long::Configure ("bundling"); -my ($device, $port, $extra, $debug, $queue_only, $rollback); +my ($device, $port, $extra, $debug, $quiet, $queue_only, $rollback); my ($infotrace, $snmptrace, $sqltrace) = (0, 0, 0); my $result = GetOptions( @@ -59,7 +57,8 @@ my $result = GetOptions( 'port|p=s' => \$port, 'extra|e=s' => \$extra, 'debug|D' => \$debug, - 'queue|q' => \$queue_only, + 'enqueue' => \$queue_only, + 'quiet' => \$quiet, 'rollback|R' => \$rollback, 'infotrace|I+' => \$infotrace, 'snmptrace|S+' => \$snmptrace, @@ -72,7 +71,7 @@ my $result = GetOptions( my $CONFIG = config(); $CONFIG->{logger} = 'console'; -$CONFIG->{log} = ($debug ? 'debug' : 'info'); +$CONFIG->{log} = ($debug ? 'debug' : ($quiet ? 'error' : 'info')); $ENV{INFO_TRACE} ||= $infotrace; $ENV{SNMP_TRACE} ||= $snmptrace; @@ -82,6 +81,8 @@ $ENV{ND2_DB_ROLLBACK} ||= $rollback; # reconfigure logging to force console output Dancer::Logger->init('console', $CONFIG); +info "App::Netdisco version $App::Netdisco::VERSION loaded."; + # get requested action (my $action = shift @ARGV) =~ s/^set_// if scalar @ARGV; @@ -171,7 +172,7 @@ netdisco-do - Run any Netdisco job from the command-line. =head1 SYNOPSIS - ~/bin/netdisco-do [-DISQRq] [-d [-p ] [-e ]] + ~/bin/netdisco-do [-DISQR] [--enqueue] [--quiet] [-d [-p ] [-e ]] =head1 DESCRIPTION @@ -183,9 +184,9 @@ Note that some jobs (C, C, C, C) simply add entries to the Netdisco job queue for other jobs, so won't seem to do much when you trigger them. Everything else happens in real-time. -However the flag "C<-q>" will force the queueing of the job, regardless of -type. This may be useful for cron-driven actions, or for actions working -across large IP spaces. +However the "C<--enqueue>" option will force the queueing of the job, +regardless of type. This may be useful for cron-driven actions, or for actions +working across large IP spaces. For any action, if you wish to run one of its individual worker stages, then pass C as the first argument to C, for example