chiark / gitweb /
git-debrebase: Implement --help, providing a summary.
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 31 Jul 2018 13:05:20 +0000 (14:05 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 31 Jul 2018 13:22:13 +0000 (14:22 +0100)
Provide a usage message.

I'm not convinced an option summary here is a good idea, mainly there
aren't any really important options.  (-f will be advertised when it
is relevant.)  So I have just summarised the most important operations.

Closes:#904990.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
debian/changelog
git-debrebase

index 4cc32d27d348e0eeec9f829de8f197391c5848b3..dd9721634c19184787539fb162b2d324a90d4993 100644 (file)
@@ -15,6 +15,8 @@ dgit (6.3~) unstable; urgency=medium
   * git-debrebase(1): Warn against plain git rebase.  (Re#905004.)
   * dgit-maint-debrebase(7): Warn more against plain git rebase.
     Closes:#905004.
   * git-debrebase(1): Warn against plain git rebase.  (Re#905004.)
   * dgit-maint-debrebase(7): Warn more against plain git rebase.
     Closes:#905004.
+  * git-debrebase: Implement --help, providing a summary.
+    Closes:#904990.
 
  --
 
 
  --
 
index 13ca472d47881b34361a8c4dc160bc0113d0f47c..b61970ce2f57bbef33a8915334a12a73e0272d28 100755 (executable)
@@ -36,6 +36,18 @@ use Dpkg::Version;
 use File::FnMatch qw(:fnmatch);
 use File::Copy;
 
 use File::FnMatch qw(:fnmatch);
 use File::Copy;
 
+our ($usage_message) = <<'END';
+usages:
+  git-debrebase [<options>] [--|-i <git rebase options...>]
+  git-debrebase [<options>] status
+  git-debrebase [<options>] prepush [--prose=...]
+  git-debrebase [<options>] quick|conclude
+  git-debrebase [<options>] new-upstream <new-version> [<details ...>]
+  git-debrebase [<options>] convert-from-gbp [<upstream-commitish>]
+  ...
+See git-debrebase(1), git-debrebase(5), dgit-maint-debrebase(7) (in dgit).
+END
+
 our ($opt_force, $opt_noop_ok, @opt_anchors);
 our ($opt_defaultcmd_interactive);
 
 our ($opt_force, $opt_noop_ok, @opt_anchors);
 our ($opt_defaultcmd_interactive);
 
@@ -1826,7 +1838,9 @@ getoptions("bad options\n",
               # approach.  '-i=s{0,}' does not work with bundling.
               push @$opt_defaultcmd_interactive, @ARGV;
               @ARGV=();
               # approach.  '-i=s{0,}' does not work with bundling.
               push @$opt_defaultcmd_interactive, @ARGV;
               @ARGV=();
-          });
+          },
+          'help' => sub { print $usage_message or die $!; finish 0; },
+          );
 
 initdebug('git-debrebase ');
 enabledebug if $debuglevel;
 
 initdebug('git-debrebase ');
 enabledebug if $debuglevel;