chiark / gitweb /
Print better message for unknown operations.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 4 Aug 2014 00:03:57 +0000 (01:03 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 4 Aug 2014 00:05:00 +0000 (01:05 +0100)
debian/changelog
dgit

index e6764a4..8695a5f 100644 (file)
@@ -29,6 +29,7 @@ dgit (0.22~experimental1) experimental; urgency=low
   * Fix a manpage reference to `--dget=' where `--dgit=' was intended.
   * Provide t-archive-process-incoming and t-archive-query subroutines for
     regression test scripts to use.
+  * Print better message for unknown operations.
 
   Major new feature, currently stalled awaiting server infrastructure:
   * dgit-repos-server: New program for receiving signed-tag-based
diff --git a/dgit b/dgit
index 4125c37..2852e13 100755 (executable)
--- a/dgit
+++ b/dgit
@@ -2218,4 +2218,7 @@ if (!@ARGV) {
 }
 my $cmd = shift @ARGV;
 $cmd =~ y/-/_/;
-{ no strict qw(refs); &{"cmd_$cmd"}(); }
+
+my $fn = ${*::}{"cmd_$cmd"};
+$fn or badusage "unknown operation $cmd";
+$fn->();