mirror of
https://github.com/ipfs/kubo.git
synced 2025-08-06 03:19:47 +08:00
cleanup
License: MIT Signed-off-by: Jeromy <why@ipfs.io>
This commit is contained in:
@ -17,6 +17,11 @@ import (
|
||||
|
||||
var log = logging.Logger("commands/cli")
|
||||
|
||||
// stdinSpecialName is a name applied to the 'stdin' file so we can differentiate
|
||||
// it from potential 'real' files being passed in. The '*' character is invalid in
|
||||
// path names and won't appear otherwise.
|
||||
const stdinSpecialName = "*stdin*"
|
||||
|
||||
// Parse parses the input commandline string (cmd, flags, and args).
|
||||
// returns the corresponding command Request object.
|
||||
func Parse(input []string, stdin *os.File, root *cmds.Command) (cmds.Request, *cmds.Command, []string, error) {
|
||||
@ -302,7 +307,7 @@ func parseArgs(inputs []string, stdin *os.File, argDefs []cmds.Argument, recursi
|
||||
return nil, nil, err
|
||||
}
|
||||
if istty {
|
||||
fname = "*stdin*"
|
||||
fname = stdinSpecialName
|
||||
}
|
||||
|
||||
fileArgs[stdin.Name()] = files.NewReaderFile(fname, "", stdin, nil)
|
||||
|
Reference in New Issue
Block a user