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
368b8062
Unverified
Commit
368b8062
authored
Apr 25, 2018
by
Whyrusleeping
Committed by
GitHub
Apr 25, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #74 from djdv/fix/win/stdio
allow stdin on Windows
parents
66802ba1
29d5b1ea
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
10 deletions
+15
-10
cli/parse.go
cli/parse.go
+9
-10
package.json
package.json
+6
-0
No files found.
cli/parse.go
View file @
368b8062
...
@@ -7,18 +7,25 @@ import (
...
@@ -7,18 +7,25 @@ import (
"os"
"os"
"path"
"path"
"path/filepath"
"path/filepath"
"runtime"
"sort"
"sort"
"strings"
"strings"
"github.com/ipfs/go-ipfs-cmdkit"
"github.com/ipfs/go-ipfs-cmdkit"
"github.com/ipfs/go-ipfs-cmdkit/files"
"github.com/ipfs/go-ipfs-cmdkit/files"
"github.com/ipfs/go-ipfs-cmds"
"github.com/ipfs/go-ipfs-cmds"
logging
"github.com/ipfs/go-log"
logging
"github.com/ipfs/go-log"
osh
"gx/ipfs/QmXuBJ7DR6k3rmUEKtvVMhwjmXDuJgXXPUt4LQXKBMsU93/go-os-helper"
)
)
var
log
=
logging
.
Logger
(
"cmds/cli"
)
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).
// Parse parses the input commandline string (cmd, flags, and args).
// returns the corresponding command Request object.
// returns the corresponding command Request object.
...
@@ -180,11 +187,6 @@ L:
...
@@ -180,11 +187,6 @@ L:
}
}
func
parseArgs
(
req
*
cmds
.
Request
,
root
*
cmds
.
Command
,
stdin
*
os
.
File
)
error
{
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
argDefs
:=
req
.
Command
.
Arguments
// count required argument definitions
// count required argument definitions
...
@@ -420,9 +422,6 @@ func (st *parseState) parseLongOpt(optDefs map[string]cmdkit.Option) (string, in
...
@@ -420,9 +422,6 @@ func (st *parseState) parseLongOpt(optDefs map[string]cmdkit.Option) (string, in
optval
,
err
:=
parseOpt
(
k
,
v
,
optDefs
)
optval
,
err
:=
parseOpt
(
k
,
v
,
optDefs
)
return
k
,
optval
,
err
return
k
,
optval
,
err
}
}
const
msgStdinInfo
=
"ipfs: Reading from %s; send Ctrl-d to stop."
func
filesMapToSortedArr
(
fs
map
[
string
]
files
.
File
)
[]
files
.
File
{
func
filesMapToSortedArr
(
fs
map
[
string
]
files
.
File
)
[]
files
.
File
{
var
names
[]
string
var
names
[]
string
for
name
,
_
:=
range
fs
{
for
name
,
_
:=
range
fs
{
...
...
package.json
View file @
368b8062
...
@@ -40,6 +40,12 @@
...
@@ -40,6 +40,12 @@
"hash"
:
"QmTVvctiHWZzSDZdyU5wdnXh7VF3kprHSyQFwVChos5qKu"
,
"hash"
:
"QmTVvctiHWZzSDZdyU5wdnXh7VF3kprHSyQFwVChos5qKu"
,
"name"
:
"golang-levenshtein"
,
"name"
:
"golang-levenshtein"
,
"version"
:
"1.0.0"
"version"
:
"1.0.0"
},
{
"author"
:
"Kubuxu"
,
"hash"
:
"QmXuBJ7DR6k3rmUEKtvVMhwjmXDuJgXXPUt4LQXKBMsU93"
,
"name"
:
"go-os-helper"
,
"version"
:
"0.0.0"
}
}
],
],
"gxVersion"
:
"0.10.0"
,
"gxVersion"
:
"0.10.0"
,
...
...
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