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
86bb8ca7
Commit
86bb8ca7
authored
10 years ago
by
Matt Bell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/commands: Enabled stdin for various command arguments
parent
70adc21d
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
15 additions
and
15 deletions
+15
-15
core/commands/block.go
core/commands/block.go
+2
-2
core/commands/id.go
core/commands/id.go
+1
-1
core/commands/ls.go
core/commands/ls.go
+1
-1
core/commands/object.go
core/commands/object.go
+4
-4
core/commands/pin.go
core/commands/pin.go
+2
-2
core/commands/ping.go
core/commands/ping.go
+1
-1
core/commands/publish.go
core/commands/publish.go
+1
-1
core/commands/refs.go
core/commands/refs.go
+1
-1
core/commands/resolve.go
core/commands/resolve.go
+1
-1
core/commands/swarm.go
core/commands/swarm.go
+1
-1
No files found.
core/commands/block.go
View file @
86bb8ca7
...
...
@@ -55,7 +55,7 @@ on raw ipfs blocks. It outputs the following to stdout:
},
Arguments
:
[]
cmds
.
Argument
{
cmds
.
StringArg
(
"key"
,
true
,
false
,
"The base58 multihash of an existing block to get"
),
cmds
.
StringArg
(
"key"
,
true
,
false
,
"The base58 multihash of an existing block to get"
)
.
EnableStdin
()
,
},
Run
:
func
(
req
cmds
.
Request
)
(
interface
{},
error
)
{
b
,
err
:=
getBlockForKey
(
req
,
req
.
Arguments
()[
0
])
...
...
@@ -87,7 +87,7 @@ It outputs to stdout, and <key> is a base58 encoded multihash.
},
Arguments
:
[]
cmds
.
Argument
{
cmds
.
StringArg
(
"key"
,
true
,
false
,
"The base58 multihash of an existing block to get"
),
cmds
.
StringArg
(
"key"
,
true
,
false
,
"The base58 multihash of an existing block to get"
)
.
EnableStdin
()
,
},
Run
:
func
(
req
cmds
.
Request
)
(
interface
{},
error
)
{
b
,
err
:=
getBlockForKey
(
req
,
req
.
Arguments
()[
0
])
...
...
This diff is collapsed.
Click to expand it.
core/commands/id.go
View file @
86bb8ca7
...
...
@@ -43,7 +43,7 @@ if no peer is specified, prints out local peers info.
`
,
},
Arguments
:
[]
cmds
.
Argument
{
cmds
.
StringArg
(
"peerid"
,
false
,
false
,
"peer.ID of node to look up"
),
cmds
.
StringArg
(
"peerid"
,
false
,
false
,
"peer.ID of node to look up"
)
.
EnableStdin
()
,
},
Run
:
func
(
req
cmds
.
Request
)
(
interface
{},
error
)
{
node
,
err
:=
req
.
Context
()
.
GetNode
()
...
...
This diff is collapsed.
Click to expand it.
core/commands/ls.go
View file @
86bb8ca7
...
...
@@ -35,7 +35,7 @@ it contains, with the following format:
},
Arguments
:
[]
cmds
.
Argument
{
cmds
.
StringArg
(
"ipfs-path"
,
true
,
true
,
"The path to the IPFS object(s) to list links from"
),
cmds
.
StringArg
(
"ipfs-path"
,
true
,
true
,
"The path to the IPFS object(s) to list links from"
)
.
EnableStdin
()
,
},
Run
:
func
(
req
cmds
.
Request
)
(
interface
{},
error
)
{
node
,
err
:=
req
.
Context
()
.
GetNode
()
...
...
This diff is collapsed.
Click to expand it.
core/commands/object.go
View file @
86bb8ca7
...
...
@@ -69,7 +69,7 @@ output is the raw data of the object.
},
Arguments
:
[]
cmds
.
Argument
{
cmds
.
StringArg
(
"key"
,
true
,
false
,
"Key of the object to retrieve, in base58-encoded multihash format"
),
cmds
.
StringArg
(
"key"
,
true
,
false
,
"Key of the object to retrieve, in base58-encoded multihash format"
)
.
EnableStdin
()
,
},
Run
:
func
(
req
cmds
.
Request
)
(
interface
{},
error
)
{
n
,
err
:=
req
.
Context
()
.
GetNode
()
...
...
@@ -93,7 +93,7 @@ multihash.
},
Arguments
:
[]
cmds
.
Argument
{
cmds
.
StringArg
(
"key"
,
true
,
false
,
"Key of the object to retrieve, in base58-encoded multihash format"
),
cmds
.
StringArg
(
"key"
,
true
,
false
,
"Key of the object to retrieve, in base58-encoded multihash format"
)
.
EnableStdin
()
,
},
Run
:
func
(
req
cmds
.
Request
)
(
interface
{},
error
)
{
n
,
err
:=
req
.
Context
()
.
GetNode
()
...
...
@@ -135,7 +135,7 @@ This command outputs data in the following encodings:
},
Arguments
:
[]
cmds
.
Argument
{
cmds
.
StringArg
(
"key"
,
true
,
false
,
"Key of the object to retrieve (in base58-encoded multihash format)"
),
cmds
.
StringArg
(
"key"
,
true
,
false
,
"Key of the object to retrieve (in base58-encoded multihash format)"
)
.
EnableStdin
()
,
},
Run
:
func
(
req
cmds
.
Request
)
(
interface
{},
error
)
{
n
,
err
:=
req
.
Context
()
.
GetNode
()
...
...
@@ -199,7 +199,7 @@ var objectStatCmd = &cmds.Command{
},
Arguments
:
[]
cmds
.
Argument
{
cmds
.
StringArg
(
"key"
,
true
,
false
,
"Key of the object to retrieve (in base58-encoded multihash format)"
),
cmds
.
StringArg
(
"key"
,
true
,
false
,
"Key of the object to retrieve (in base58-encoded multihash format)"
)
.
EnableStdin
()
,
},
Run
:
func
(
req
cmds
.
Request
)
(
interface
{},
error
)
{
n
,
err
:=
req
.
Context
()
.
GetNode
()
...
...
This diff is collapsed.
Click to expand it.
core/commands/pin.go
View file @
86bb8ca7
...
...
@@ -31,7 +31,7 @@ on disk.
},
Arguments
:
[]
cmds
.
Argument
{
cmds
.
StringArg
(
"ipfs-path"
,
true
,
true
,
"Path to object(s) to be pinned"
),
cmds
.
StringArg
(
"ipfs-path"
,
true
,
true
,
"Path to object(s) to be pinned"
)
.
EnableStdin
()
,
},
Options
:
[]
cmds
.
Option
{
cmds
.
BoolOption
(
"recursive"
,
"r"
,
"Recursively pin the object linked to by the specified object(s)"
),
...
...
@@ -71,7 +71,7 @@ collected if needed.
},
Arguments
:
[]
cmds
.
Argument
{
cmds
.
StringArg
(
"ipfs-path"
,
true
,
true
,
"Path to object(s) to be unpinned"
),
cmds
.
StringArg
(
"ipfs-path"
,
true
,
true
,
"Path to object(s) to be unpinned"
)
.
EnableStdin
()
,
},
Options
:
[]
cmds
.
Option
{
cmds
.
BoolOption
(
"recursive"
,
"r"
,
"Recursively unpin the object linked to by the specified object(s)"
),
...
...
This diff is collapsed.
Click to expand it.
core/commands/ping.go
View file @
86bb8ca7
...
...
@@ -37,7 +37,7 @@ trip latency information.
`
,
},
Arguments
:
[]
cmds
.
Argument
{
cmds
.
StringArg
(
"peer ID"
,
true
,
true
,
"ID of peer to be pinged"
),
cmds
.
StringArg
(
"peer ID"
,
true
,
true
,
"ID of peer to be pinged"
)
.
EnableStdin
()
,
},
Options
:
[]
cmds
.
Option
{
cmds
.
IntOption
(
"count"
,
"n"
,
"number of ping messages to send"
),
...
...
This diff is collapsed.
Click to expand it.
core/commands/publish.go
View file @
86bb8ca7
...
...
@@ -44,7 +44,7 @@ Publish a <ref> to another public key:
Arguments
:
[]
cmds
.
Argument
{
cmds
.
StringArg
(
"name"
,
false
,
false
,
"The IPNS name to publish to. Defaults to your node's peerID"
),
cmds
.
StringArg
(
"ipfs-path"
,
true
,
false
,
"IPFS path of the obejct to be published at <name>"
),
cmds
.
StringArg
(
"ipfs-path"
,
true
,
false
,
"IPFS path of the obejct to be published at <name>"
)
.
EnableStdin
()
,
},
Run
:
func
(
req
cmds
.
Request
)
(
interface
{},
error
)
{
log
.
Debug
(
"Begin Publish"
)
...
...
This diff is collapsed.
Click to expand it.
core/commands/refs.go
View file @
86bb8ca7
...
...
@@ -45,7 +45,7 @@ Note: list all refs recursively with -r.
"local"
:
RefsLocalCmd
,
},
Arguments
:
[]
cmds
.
Argument
{
cmds
.
StringArg
(
"ipfs-path"
,
true
,
true
,
"Path to the object(s) to list refs from"
),
cmds
.
StringArg
(
"ipfs-path"
,
true
,
true
,
"Path to the object(s) to list refs from"
)
.
EnableStdin
()
,
},
Options
:
[]
cmds
.
Option
{
cmds
.
StringOption
(
"format"
,
"Emit edges with given format. tokens: <src> <dst> <linkname>"
),
...
...
This diff is collapsed.
Click to expand it.
core/commands/resolve.go
View file @
86bb8ca7
...
...
@@ -38,7 +38,7 @@ Resolve te value of another name:
},
Arguments
:
[]
cmds
.
Argument
{
cmds
.
StringArg
(
"name"
,
false
,
false
,
"The IPNS name to resolve. Defaults to your node's peerID."
),
cmds
.
StringArg
(
"name"
,
false
,
false
,
"The IPNS name to resolve. Defaults to your node's peerID."
)
.
EnableStdin
()
,
},
Run
:
func
(
req
cmds
.
Request
)
(
interface
{},
error
)
{
...
...
This diff is collapsed.
Click to expand it.
core/commands/swarm.go
View file @
86bb8ca7
...
...
@@ -83,7 +83,7 @@ ipfs swarm connect /ip4/104.131.131.82/tcp/4001/QmaCpDMGvV2BGHeYERUEnRQAwe3N8Szb
`
,
},
Arguments
:
[]
cmds
.
Argument
{
cmds
.
StringArg
(
"address"
,
true
,
true
,
"address of peer to connect to"
),
cmds
.
StringArg
(
"address"
,
true
,
true
,
"address of peer to connect to"
)
.
EnableStdin
()
,
},
Run
:
func
(
req
cmds
.
Request
)
(
interface
{},
error
)
{
ctx
:=
context
.
TODO
()
...
...
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