Skip to content

Commit 7245975

Browse files
Merge pull request #634 from bartlettroscoe/gitdist-h
Make -h go to gitdist help, not git help
2 parents 3e44c31 + b82be46 commit 7245975

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

test/python_utils/gitdist_UnitTests.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,6 +1220,13 @@ def test_help(self):
12201220
GeneralScriptSupport.extractLinesMatchingRegex(cmndOut,"^OVERVIEW:$"), "")
12211221
self.assertEqual(
12221222
GeneralScriptSupport.extractLinesMatchingRegex(cmndOut,"^REPO SELECTION AND SETUP:$"), "")
1223+
def test_short_help(self):
1224+
cmndOut = getCmndOutput(gitdistPath+" -h")
1225+
assertContainsGitdistHelpHeader(self, cmndOut)
1226+
self.assertEqual(
1227+
GeneralScriptSupport.extractLinesMatchingRegex(cmndOut,"^OVERVIEW:$"), "")
1228+
self.assertEqual(
1229+
GeneralScriptSupport.extractLinesMatchingRegex(cmndOut,"^REPO SELECTION AND SETUP:$"), "")
12231230

12241231

12251232
# Make sure --dist-help= does not print OVERVIEW section

tribits/python_utils/gitdist.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1152,6 +1152,7 @@ def getCommandlineOps():
11521152

11531153
distHelpArgName = "--dist-help" # Must match --dist-help before --help!
11541154
helpArgName = "--help"
1155+
shortHelpArgName = "-h"
11551156
withGitArgName = "--dist-use-git"
11561157
reposArgName = "--dist-repos"
11571158
notReposArgName = "--dist-not-repos"
@@ -1164,7 +1165,7 @@ def getCommandlineOps():
11641165
legendName = "--dist-legend"
11651166
shortName = "--dist-short"
11661167

1167-
nativeArgNames = [ distHelpArgName, helpArgName, withGitArgName, \
1168+
nativeArgNames = [ distHelpArgName, helpArgName, shortHelpArgName, withGitArgName, \
11681169
reposArgName, notReposArgName, \
11691170
versionFileName, versionFile2Name, noColorArgName, debugArgName, noOptName, \
11701171
modifiedOnlyName, legendName, shortName ]

0 commit comments

Comments
 (0)