Commit 86bb8ca7 authored by Matt Bell's avatar Matt Bell

core/commands: Enabled stdin for various command arguments

parent 70adc21d
......@@ -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])
......
......@@ -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()
......
......@@ -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()
......
......@@ -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()
......
......@@ -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)"),
......
......@@ -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"),
......
......@@ -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")
......
......@@ -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>"),
......
......@@ -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) {
......
......@@ -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()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment