Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions cli/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,25 @@ import (
"os"
"path"
"path/filepath"
"runtime"
"sort"
"strings"

"github.com/ipfs/go-ipfs-cmdkit"
"github.com/ipfs/go-ipfs-cmdkit/files"
"github.com/ipfs/go-ipfs-cmds"

logging "github.com/ipfs/go-log"

osh "gx/ipfs/QmXuBJ7DR6k3rmUEKtvVMhwjmXDuJgXXPUt4LQXKBMsU93/go-os-helper"
)

var log = logging.Logger("cmds/cli")
var msgStdinInfo = "ipfs: Reading from %s; send Ctrl-d to stop."

func init() {
if osh.IsWindows() {
msgStdinInfo = "ipfs: Reading from %s; send Ctrl-z to stop."
}
}

// Parse parses the input commandline string (cmd, flags, and args).
// returns the corresponding command Request object.
Expand Down Expand Up @@ -184,11 +191,6 @@ L:
}

func parseArgs(req *cmds.Request, root *cmds.Command, stdin *os.File) error {
// ignore stdin on Windows
if runtime.GOOS == "windows" {
stdin = nil
}

argDefs := req.Command.Arguments

// count required argument definitions
Expand Down Expand Up @@ -424,9 +426,6 @@ func (st *parseState) parseLongOpt(optDefs map[string]cmdkit.Option) (string, in
optval, err := parseOpt(k, v, optDefs)
return k, optval, err
}

const msgStdinInfo = "ipfs: Reading from %s; send Ctrl-d to stop."

func filesMapToSortedArr(fs map[string]files.File) []files.File {
var names []string
for name, _ := range fs {
Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@
"hash": "QmTVvctiHWZzSDZdyU5wdnXh7VF3kprHSyQFwVChos5qKu",
"name": "golang-levenshtein",
"version": "1.0.0"
},
{
"author": "Kubuxu",
"hash": "QmXuBJ7DR6k3rmUEKtvVMhwjmXDuJgXXPUt4LQXKBMsU93",
"name": "go-os-helper",
"version": "0.0.0"
}
],
"gxVersion": "0.10.0",
Expand Down