use -h for synopsis and --help for manpage consistently
A few scripted Porcelain implementations pretend as if the routine to show their own help messages are triggered upon "git cmd --help", but a command line parser of "git" will hijack such a request and shows the manpage for the cmd subcommand. Leaving the code to handle such input is simply misleading. Signed-off-by: Clemens Buchacher <drizzd@aon.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Clemens Buchacher committed
Oct 3, 2011 at 20:21 UTC
87182b17ed471a7b9cbbc24e1c02f90c8725dc6f
6 files changed
+6
-7
Documentation/blame-options.txt
-1
@@ -117,5 +117,4 @@ commit. And the default value is 40. If there are more than one
117
take effect.
118
119
-h::
120
---help::
120
Show help message.
git-cvsserver.perl
+2
-2
@@ -109,14 +109,14 @@ my $usage =
109
" --strict-paths : Don't allow recursing into subdirectories\n".
110
" --export-all : Don't check for gitcvs.enabled in config\n".
111
" --version, -V : Print version information and exit\n".
112
- " --help, -h, -H : Print usage information and exit\n".
112
+ " -h, -H : Print usage information and exit\n".
113
"\n".
114
"<directory> ... is a list of allowed directories. If no directories\n".
115
"are given, all are allowed. This is an additional restriction, gitcvs\n".
116
"access still needs to be enabled by the gitcvs.enabled config option.\n".
117
"Alternately, one directory may be specified in GIT_CVSSERVER_ROOT.\n";
118
119
-my @opts = ( 'help|h|H', 'version|V',
119
+my @opts = ( 'h|H', 'version|V',
120
'base-path=s', 'strict-paths', 'export-all' );
121
GetOptions( $state, @opts )
122
or die $usage;
git-difftool.perl
+1
-1
@@ -97,7 +97,7 @@ sub generate_command
97
$prompt = 'yes';
98
next;
99
}
100
- if ($arg eq '-h' || $arg eq '--help') {
100
+ if ($arg eq '-h') {
101
usage();
102
}
103
push @command, $arg;
git-pull.sh
+1
-1
@@ -120,7 +120,7 @@ do
120
--d|--dr|--dry|--dry-|--dry-r|--dry-ru|--dry-run)
121
dry_run=--dry-run
122
;;
123
- -h|--h|--he|--hel|--help|--help-|--help-a|--help-al|--help-all)
123
+ -h|--help-all)
124
usage
125
;;
126
*)
git-sh-setup.sh
+1
-1
@@ -90,7 +90,7 @@ $LONG_USAGE"
90
fi
91
92
case "$1" in
93
- -h|--h|--he|--hel|--help)
93
+ -h)
94
echo "$LONG_USAGE"
95
exit
96
esac
git-svn.perl
+1
-1
@@ -299,7 +299,7 @@ read_git_config(\%opts);
299
if ($cmd && ($cmd eq 'log' || $cmd eq 'blame')) {
300
Getopt::Long::Configure('pass_through');
301
}
302
-my $rv = GetOptions(%opts, 'help|H|h' => \$_help, 'version|V' => \$_version,
302
+my $rv = GetOptions(%opts, 'h|H' => \$_help, 'version|V' => \$_version,
303
'minimize-connections' => \$Git::SVN::Migration::_minimize,
304
'id|i=s' => \$Git::SVN::default_ref_id,
305
'svn-remote|remote|R=s' => sub {