Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
92528ba7
Commit
92528ba7
authored
Oct 20, 2014
by
Juan Batiz-Benet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Sub -> Subcommand
parent
84fa7bc4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
commands/cli/parse.go
commands/cli/parse.go
+1
-1
commands/command.go
commands/command.go
+3
-3
No files found.
commands/cli/parse.go
View file @
92528ba7
...
...
@@ -33,7 +33,7 @@ func parsePath(input []string, root *commands.Command) ([]string, []string, erro
break
}
cmd
:=
cmd
.
Sub
(
blob
)
cmd
:=
cmd
.
Sub
command
(
blob
)
if
cmd
==
nil
{
break
}
...
...
commands/command.go
View file @
92528ba7
...
...
@@ -82,7 +82,7 @@ func (c *Command) Resolve(path []string) ([]*Command, error) {
cmd
:=
c
for
i
,
name
:=
range
path
{
cmd
=
cmd
.
Sub
(
name
)
cmd
=
cmd
.
Sub
command
(
name
)
if
cmd
==
nil
{
pathS
:=
strings
.
Join
(
path
[
0
:
i
],
"/"
)
...
...
@@ -128,8 +128,8 @@ func (c *Command) GetOptions(path []string) (map[string]Option, error) {
return
optionsMap
,
nil
}
// Sub returns the subcommand with the given id
func
(
c
*
Command
)
Sub
(
id
string
)
*
Command
{
// Sub
command
returns the subcommand with the given id
func
(
c
*
Command
)
Sub
command
(
id
string
)
*
Command
{
return
c
.
subcommands
[
id
]
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment