[Rt-commit] rt branch, 4.4-trunk, updated. rt-4.4.4-447-g14550358c9

Jim Brandt jbrandt at bestpractical.com
Mon May 10 17:46:20 EDT 2021


The branch, 4.4-trunk has been updated
       via  14550358c995ca10dffdfbb883749cb169771245 (commit)
       via  9b7bb8689a350f7822ef79749a57db84f46d1031 (commit)
       via  ee5c1df23fdfc83c27499903d1bacd2c76d88f48 (commit)
       via  90bbff572425b084ec89fbecd93c82bbb2d3025b (commit)
      from  994bfb3ad812c2b76cc701b94c09c43e794a85a8 (commit)

Summary of changes:
 bin/rt-crontool.in      | 12 +++++++++---
 lib/RT/Interface/CLI.pm |  2 +-
 2 files changed, 10 insertions(+), 4 deletions(-)

- Log -----------------------------------------------------------------
commit ee5c1df23fdfc83c27499903d1bacd2c76d88f48
Merge: 994bfb3ad8 90bbff5724
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Mon May 10 16:40:21 2021 -0400

    Merge branch '4.4/crontool-dry-run' into 4.4-trunk

diff --cc bin/rt-crontool.in
index bca6cd4147,fcda651a21..53a87699fe
--- a/bin/rt-crontool.in
+++ b/bin/rt-crontool.in
@@@ -71,13 -71,11 +71,13 @@@ use RT
  
  use Getopt::Long;
  
 -use RT::Interface::CLI qw(GetCurrentUser loc);
 +use RT::Interface::CLI qw(GetCurrentUser Init loc);
  
  my ( $search, $condition, $actions, $search_arg, $condition_arg, $actions_arg,
 -     $template, $template_id, $transaction, $transaction_type, $help, $log, $verbose, $dryrun );
 -GetOptions(
 +     $template, $template_id, $transaction, $transaction_type, $reload_ticket, $help, $log, $verbose,
-      $max_processes, $max_tickets_per_process );
++     $max_processes, $max_tickets_per_process, $dryrun );
 +
 +my %OPT = (
      "search=s"           => \$search,
      "search-arg=s"       => \$search_arg,
      "condition=s"        => \$condition,
@@@ -88,15 -86,14 +88,16 @@@
      "template-id=s"      => \$template_id,
      "transaction=s"      => \$transaction,
      "transaction-type=s" => \$transaction_type,
 +    "reload-ticket"      => \$reload_ticket,
 +    "max-processes=i"    => \$max_processes,
 +    "max-tickets-per-process=i" => \$max_tickets_per_process,
      "log=s"              => \$log,
      "verbose|v"          => \$verbose,
 +    "verbose"            => 1,  # tell Init we have a verbose
+     "dry-run"            => \$dryrun,
 -    "help"               => \$help,
  );
  
 -# Load the config file
 -RT::LoadConfig();
 +Init( %OPT );
  
  # adjust logging to the screen according to options
  RT->Config->Set( LogToSTDERR => $log ) if $log;

commit 9b7bb8689a350f7822ef79749a57db84f46d1031
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Mon May 10 17:24:24 2021 -0400

    Add a rule to explicitly handle verbose|v in CLI
    
    rt-crontool defines the verbose flag with the option to
    also use the letter v like 'verbose|v'. Since that didn't
    match the exception in CLI's Init, 6076e50322 included
    an entry in OPT to set 'verbose' to 1 to skip the default
    verbose behavior. It turned out that only worked sometimes
    based on the hash order, which is random. Sometimes $verbose
    would not be defined.
    
    Add an explicit exception in the Init handler to match on the
    'verbose|v' alternate to allow $verbose to be set and
    used in rt-crontool.

diff --git a/bin/rt-crontool.in b/bin/rt-crontool.in
index 53a87699fe..4c9e8116d6 100644
--- a/bin/rt-crontool.in
+++ b/bin/rt-crontool.in
@@ -93,7 +93,6 @@ my %OPT = (
     "max-tickets-per-process=i" => \$max_tickets_per_process,
     "log=s"              => \$log,
     "verbose|v"          => \$verbose,
-    "verbose"            => 1,  # tell Init we have a verbose
     "dry-run"            => \$dryrun,
 );
 
diff --git a/lib/RT/Interface/CLI.pm b/lib/RT/Interface/CLI.pm
index 617e83d0c8..6972e626ef 100644
--- a/lib/RT/Interface/CLI.pm
+++ b/lib/RT/Interface/CLI.pm
@@ -205,7 +205,7 @@ sub Init {
         unless $exists{help};
 
     push @args, "verbose|v!" => \($hash->{verbose})
-        unless $exists{verbose};
+        unless ( $exists{verbose} || $exists{'verbose|v'} );
 
     push @args, "debug!" => \($hash->{verbose})
         if $exists{debug};

commit 14550358c995ca10dffdfbb883749cb169771245
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Mon May 10 17:30:31 2021 -0400

    Remove unused local $help variable
    
    6076e503 moved help handling to the CLI module, so the
    local $help is no longer needed in rt-crontool.

diff --git a/bin/rt-crontool.in b/bin/rt-crontool.in
index 4c9e8116d6..6a041af7d3 100644
--- a/bin/rt-crontool.in
+++ b/bin/rt-crontool.in
@@ -74,7 +74,7 @@ use Getopt::Long;
 use RT::Interface::CLI qw(GetCurrentUser Init loc);
 
 my ( $search, $condition, $actions, $search_arg, $condition_arg, $actions_arg,
-     $template, $template_id, $transaction, $transaction_type, $reload_ticket, $help, $log, $verbose,
+     $template, $template_id, $transaction, $transaction_type, $reload_ticket, $log, $verbose,
      $max_processes, $max_tickets_per_process, $dryrun );
 
 my %OPT = (

-----------------------------------------------------------------------


More information about the rt-commit mailing list