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
9ff238e8
Commit
9ff238e8
authored
8 years ago
by
Jeromy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
a little more cleanup
License: MIT Signed-off-by:
Jeromy
<
why@ipfs.io
>
parent
c1425346
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
16 deletions
+10
-16
commands/cli/parse.go
commands/cli/parse.go
+10
-16
No files found.
commands/cli/parse.go
View file @
9ff238e8
...
...
@@ -304,12 +304,10 @@ func parseArgs(inputs []string, stdin *os.File, argDefs []cmds.Argument, recursi
case
cmds
.
ArgString
:
if
len
(
inputs
)
>
0
{
stringArgs
,
inputs
=
append
(
stringArgs
,
inputs
[
0
]),
inputs
[
1
:
]
}
else
{
if
stdin
!=
nil
&&
argDef
.
SupportsStdin
&&
!
fillingVariadic
{
if
err
:=
printReadInfo
(
stdin
,
msgStdinInfo
);
err
==
nil
{
fileArgs
[
stdin
.
Name
()]
=
files
.
NewReaderFile
(
"stdin"
,
""
,
stdin
,
nil
)
stdin
=
nil
}
}
else
if
stdin
!=
nil
&&
argDef
.
SupportsStdin
&&
!
fillingVariadic
{
if
err
:=
printReadInfo
(
stdin
,
msgStdinInfo
);
err
==
nil
{
fileArgs
[
stdin
.
Name
()]
=
files
.
NewReaderFile
(
"stdin"
,
""
,
stdin
,
nil
)
stdin
=
nil
}
}
case
cmds
.
ArgFile
:
...
...
@@ -332,17 +330,13 @@ func parseArgs(inputs []string, stdin *os.File, argDefs []cmds.Argument, recursi
}
fileArgs
[
fpath
]
=
file
}
else
{
if
stdin
!=
nil
&&
argDef
.
SupportsStdin
&&
argDef
.
Required
&&
!
fillingVariadic
{
if
err
:=
printReadInfo
(
stdin
,
msgStdinInfo
);
err
!=
nil
{
return
nil
,
nil
,
err
}
fpath
:=
stdin
.
Name
()
fileArgs
[
fpath
]
=
files
.
NewReaderFile
(
""
,
fpath
,
stdin
,
nil
)
}
else
{
break
}
else
if
stdin
!=
nil
&&
argDef
.
SupportsStdin
&&
argDef
.
Required
&&
!
fillingVariadic
{
if
err
:=
printReadInfo
(
stdin
,
msgStdinInfo
);
err
!=
nil
{
return
nil
,
nil
,
err
}
fpath
:=
stdin
.
Name
()
fileArgs
[
fpath
]
=
files
.
NewReaderFile
(
""
,
fpath
,
stdin
,
nil
)
}
}
...
...
This diff is collapsed.
Click to expand it.
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