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
218d5264
Commit
218d5264
authored
Nov 07, 2014
by
Matt Bell
Committed by
Juan Batiz-Benet
Nov 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/commands2: Added descriptions for 'add', 'block'
parent
351ed958
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
24 deletions
+16
-24
core/commands2/add.go
core/commands2/add.go
+4
-7
core/commands2/block.go
core/commands2/block.go
+12
-17
No files found.
core/commands2/add.go
View file @
218d5264
...
...
@@ -21,16 +21,13 @@ type AddOutput struct {
var
addCmd
=
&
cmds
.
Command
{
Options
:
[]
cmds
.
Option
{
cmds
.
Option
{[]
string
{
"recursive"
,
"r"
},
cmds
.
Bool
},
cmds
.
Option
{[]
string
{
"recursive"
,
"r"
},
cmds
.
Bool
,
"Must be specified when adding directories"
},
},
Arguments
:
[]
cmds
.
Argument
{
cmds
.
Argument
{
"file"
,
cmds
.
ArgFile
,
false
,
true
},
cmds
.
Argument
{
"file"
,
cmds
.
ArgFile
,
false
,
true
,
"The path to a file to be added to IPFS"
},
},
// TODO UsageLine: "add",
// TODO Short: "Add an object to ipfs.",
Help
:
`ipfs add <path>... - Add objects to ipfs.
Adds contents of <path> to ipfs. Use -r to add directories.
Description
:
"Add an object to ipfs."
,
Help
:
`Adds contents of <path> to ipfs. Use -r to add directories.
Note that directories are added recursively, to form the ipfs
MerkleDAG. A smarter partial add with a staging area (like git)
remains to be implemented.
...
...
core/commands2/block.go
View file @
218d5264
...
...
@@ -22,14 +22,9 @@ type Block struct {
}
var
blockCmd
=
&
cmds
.
Command
{
Help
:
`ipfs block - manipulate raw ipfs blocks
ipfs block get <key> - get and output block named by <key>
ipfs block put - store stdin as a block, outputs <key>
ipfs block is a plumbing command used to manipulate raw ipfs blocks.
Reads from stdin or writes to stdout, and <key> is a base58 encoded
multihash.`
,
Description
:
"Manipulate raw IPFS blocks"
,
Help
:
`'ipfs block' is a plumbing command used to manipulate raw ipfs blocks.
Reads from stdin or writes to stdout.`
,
Subcommands
:
map
[
string
]
*
cmds
.
Command
{
"get"
:
blockGetCmd
,
"put"
:
blockPutCmd
,
...
...
@@ -37,13 +32,12 @@ multihash.`,
}
var
blockGetCmd
=
&
cmds
.
Command
{
Description
:
"Get a raw IPFS block"
,
Help
:
`'ipfs block get' is a plumbing command for retreiving raw ipfs blocks.`
,
Arguments
:
[]
cmds
.
Argument
{
cmds
.
Argument
{
"key"
,
cmds
.
ArgString
,
true
,
false
},
cmds
.
Argument
{
"key"
,
cmds
.
ArgString
,
true
,
false
,
"The base58 multihash of an existing block to get"
},
},
Help
:
`ipfs get <key> - gets and outputs block named by <key>
'ipfs block get' is a plumbing command for retreiving raw ipfs blocks.
<key> is a base58 encoded multihash`
,
Run
:
func
(
res
cmds
.
Response
,
req
cmds
.
Request
)
{
n
:=
req
.
Context
()
.
Node
...
...
@@ -77,12 +71,13 @@ var blockGetCmd = &cmds.Command{
}
var
blockPutCmd
=
&
cmds
.
Command
{
Description
:
"Stores input as an IPFS block"
,
Help
:
`'ipfs block put' is a plumbing command for storing raw ipfs blocks.
It outputs the key of the stored block.`
,
Arguments
:
[]
cmds
.
Argument
{
cmds
.
Argument
{
"data"
,
cmds
.
ArgFile
,
true
,
false
},
cmds
.
Argument
{
"data"
,
cmds
.
ArgFile
,
true
,
false
,
"The data to be stored as an IPFS block"
},
},
Help
:
`ipfs put - stores input as a block, outputs its key
ipfs block put is a plumbing command for storing raw ipfs blocks.`
,
Run
:
func
(
res
cmds
.
Response
,
req
cmds
.
Request
)
{
n
:=
req
.
Context
()
.
Node
...
...
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