chiark / gitweb /
dgit: Refactor to create human-readable $subcommand
authorSean Whitton <spwhitton@spwhitton.name>
Fri, 3 Feb 2017 04:11:09 +0000 (21:11 -0700)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 26 Jul 2017 21:52:28 +0000 (22:52 +0100)
$cmd,$subcommand now global vars.

No functional change.

Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Acked-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
dgit

diff --git a/dgit b/dgit
index 28795fec9f5a130bf530da26bb323863281391e6..c344d31ea2dba92e699fb9006ae39f0781c6f842 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -47,6 +47,8 @@ our $absurdity = undef; ###substituted###
 our @rpushprotovsn_support = qw(4 3 2); # 4 is new tag format
 our $protovsn;
 
+our $cmd;
+our $subcommand;
 our $isuite;
 our $idistro;
 our $package;
@@ -6795,7 +6797,7 @@ if (!@ARGV) {
     print STDERR $helpmsg or die $!;
     exit 8;
 }
-my $cmd = shift @ARGV;
+$cmd = $subcommand = shift @ARGV;
 $cmd =~ y/-/_/;
 
 my $pre_fn = ${*::}{"pre_$cmd"};