From: Ian Jackson Date: Mon, 4 Aug 2014 00:03:57 +0000 (+0100) Subject: Print better message for unknown operations. X-Git-Tag: debian/0.22~17 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=a3522f3c05881c36b5630fc6aaa21dde22b5dd06;ds=sidebyside Print better message for unknown operations. --- diff --git a/debian/changelog b/debian/changelog index e6764a4f..8695a5f4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 4125c37a..2852e134 100755 --- 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->();