Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
installsystems
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Seblu
installsystems
Commits
5a82232b
Commit
5a82232b
authored
13 years ago
by
Aurélien Dunand
Committed by
Seblu
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
help command can now displays subparsers' help
parent
71960022
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/is
+7
-2
7 additions, 2 deletions
bin/is
with
7 additions
and
2 deletions
bin/is
+
7
−
2
View file @
5a82232b
...
@@ -237,7 +237,10 @@ def c_help(parser, args):
...
@@ -237,7 +237,10 @@ def c_help(parser, args):
'''
'''
Show help
Show help
'''
'''
parser
.
print_help
()
if
args
.
command
is
None
:
parser
.
print_help
()
else
:
args
.
subparser
.
choices
[
args
.
command
].
print_help
()
def
c_version
(
parser
,
args
):
def
c_version
(
parser
,
args
):
'''
'''
...
@@ -358,7 +361,9 @@ p_clean.set_defaults(func=c_clean)
...
@@ -358,7 +361,9 @@ p_clean.set_defaults(func=c_clean)
# help command parser
# help command parser
p_help
=
subparsers
.
add_parser
(
"
help
"
,
help
=
c_help
.
__doc__
.
lower
())
p_help
=
subparsers
.
add_parser
(
"
help
"
,
help
=
c_help
.
__doc__
.
lower
())
p_help
.
set_defaults
(
func
=
c_help
)
p_help
.
add_argument
(
"
command
"
,
choices
=
subparsers
.
choices
,
nargs
=
"
?
"
,
help
=
"
command name
"
)
p_help
.
set_defaults
(
func
=
c_help
,
subparser
=
subparsers
)
# version command parser
# version command parser
p_version
=
subparsers
.
add_parser
(
"
version
"
,
help
=
c_version
.
__doc__
.
lower
())
p_version
=
subparsers
.
add_parser
(
"
version
"
,
help
=
c_version
.
__doc__
.
lower
())
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment