X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=clearadm%2Fclearexec.pl;h=057caab384981d25906dbeb23ee574127bd47a53;hb=7ddf095f187ca60d9a70fb83b2bc3c2b6d91f088;hp=53963a74ad7cabf0b2c0e545cda6d9b32e9575cd;hpb=81cbd130706633b1c19ff59371c2ef61d80c562b;p=clearscm.git diff --git a/clearadm/clearexec.pl b/clearadm/clearexec.pl index 53963a7..057caab 100755 --- a/clearadm/clearexec.pl +++ b/clearadm/clearexec.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl =pod @@ -55,7 +55,7 @@ use warnings; use Getopt::Long; use FindBin; -use Term::ANSIColor qw (color); +use Term::ANSIColor qw(color); use lib "$FindBin::Bin/lib", "$FindBin::Bin/../lib"; @@ -77,18 +77,18 @@ my $port = $Clearexec::CLEAROPTS{CLEAREXEC_PORT}; my $clearexec; -sub CmdLoop () { +sub CmdLoop() { my ($line, $result); - my $prompt = color ('BOLD YELLOW') . "$me->$host:" . color ('RESET'); + my $prompt = color('BOLD YELLOW') . "$me->$host:" . color('RESET'); - $CmdLine::cmdline->set_prompt ($prompt); + $CmdLine::cmdline->set_prompt($prompt); - while (($line, $result) = $CmdLine::cmdline->get ()) { + while (($line, $result) = $CmdLine::cmdline->get()) { last unless defined $line; last if $line =~ /exit|quit/i; - my ($status, @output) = $clearexec->execute ($line); + my ($status, @output) = $clearexec->execute($line); last if $line =~ /stopserver/i; @@ -105,7 +105,7 @@ sub CmdLoop () { } # CmdLoop # Main -GetOptions ( +GetOptions( 'usage' => sub { Usage }, 'verbose' => sub { set_verbose }, 'debug' => sub { set_debug }, @@ -117,20 +117,19 @@ my $cmd = join ' ', @ARGV; verbose "$FindBin::Script V$VERSION"; -$clearexec =Clearexec->new; +$clearexec = Clearexec->new; my ($status, @output); -$status = $clearexec->connectToServer ($host, $port); +$status = $clearexec->connectToServer($host, $port); -error "Unable to connect to $host:$port", 1 - unless $status; +error "Unable to connect to $host:$port", 1 unless $status; if ($cmd ne '') { - ($status, @output) = $clearexec->execute ($cmd); + ($status, @output) = $clearexec->execute($cmd); if ($status) { - error "Unable to execute $cmd (Status: $status)\n" . join ("\n", @output), 1; + error "Unable to execute $cmd (Status: $status)\n" . join("\n", @output), 1; } else { display join "\n", @output; display "Status: $status";