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-cmds
Commits
4e77470d
Commit
4e77470d
authored
May 17, 2015
by
Christian Couder
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parse: fix parsing stdin args
License: MIT Signed-off-by:
Christian Couder
<
chriscool@tuxfamily.org
>
parent
25d1954f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
cli/parse.go
cli/parse.go
+4
-4
No files found.
cli/parse.go
View file @
4e77470d
...
...
@@ -250,11 +250,11 @@ func parseArgs(inputs []string, stdin *os.File, argDefs []cmds.Argument, recursi
var
err
error
if
argDef
.
Type
==
cmds
.
ArgString
{
if
stdin
==
nil
{
if
stdin
==
nil
||
!
argDef
.
SupportsStdin
{
// add string values
stringArgs
,
inputs
=
appendString
(
stringArgs
,
inputs
)
}
else
if
argDef
.
SupportsStdin
{
}
else
{
if
len
(
inputs
)
>
0
{
// don't use stdin if we have inputs
stdin
=
nil
...
...
@@ -267,14 +267,14 @@ func parseArgs(inputs []string, stdin *os.File, argDefs []cmds.Argument, recursi
}
}
}
else
if
argDef
.
Type
==
cmds
.
ArgFile
{
if
stdin
==
nil
{
if
stdin
==
nil
||
!
argDef
.
SupportsStdin
{
// treat stringArg values as file paths
fileArgs
,
inputs
,
err
=
appendFile
(
fileArgs
,
inputs
,
argDef
,
recursive
)
if
err
!=
nil
{
return
nil
,
nil
,
err
}
}
else
if
argDef
.
SupportsStdin
{
}
else
{
if
len
(
inputs
)
>
0
{
// don't use stdin if we have inputs
stdin
=
nil
...
...
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