From 218d52642cd6962b09a48eb7aae184c851da89f2 Mon Sep 17 00:00:00 2001 From: Matt Bell Date: Fri, 7 Nov 2014 21:09:18 -0800 Subject: [PATCH] core/commands2: Added descriptions for 'add', 'block' --- core/commands2/add.go | 11 ++++------- core/commands2/block.go | 33 ++++++++++++++------------------- 2 files changed, 18 insertions(+), 26 deletions(-) diff --git a/core/commands2/add.go b/core/commands2/add.go index ed4a676fc..104f506ad 100644 --- a/core/commands2/add.go +++ b/core/commands2/add.go @@ -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 ... - Add objects to ipfs. - - Adds contents of to ipfs. Use -r to add directories. + Description: "Add an object to ipfs.", + Help: `Adds contents of 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. diff --git a/core/commands2/block.go b/core/commands2/block.go index 0fd571a3d..1c6fb386c 100644 --- a/core/commands2/block.go +++ b/core/commands2/block.go @@ -22,14 +22,9 @@ type Block struct { } var blockCmd = &cmds.Command{ - Help: `ipfs block - manipulate raw ipfs blocks - - ipfs block get - get and output block named by - ipfs block put - store stdin as a block, outputs - -ipfs block is a plumbing command used to manipulate raw ipfs blocks. -Reads from stdin or writes to stdout, and 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{ - Arguments: []cmds.Argument{ - cmds.Argument{"key", cmds.ArgString, true, false}, - }, - Help: `ipfs get - gets and outputs block named by + Description: "Get a raw IPFS block", + Help: `'ipfs block get' is a plumbing command for retreiving raw ipfs blocks.`, -'ipfs block get' is a plumbing command for retreiving raw ipfs blocks. - is a base58 encoded multihash`, + Arguments: []cmds.Argument{ + cmds.Argument{"key", cmds.ArgString, true, false, "The base58 multihash of an existing block to get"}, + }, Run: func(res cmds.Response, req cmds.Request) { n := req.Context().Node @@ -77,12 +71,13 @@ var blockGetCmd = &cmds.Command{ } var blockPutCmd = &cmds.Command{ - Arguments: []cmds.Argument{ - cmds.Argument{"data", cmds.ArgFile, true, false}, - }, - Help: `ipfs put - stores input as a block, outputs its key + 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.`, -ipfs block put is a plumbing command for storing raw ipfs blocks.`, + Arguments: []cmds.Argument{ + cmds.Argument{"data", cmds.ArgFile, true, false, "The data to be stored as an IPFS block"}, + }, Run: func(res cmds.Response, req cmds.Request) { n := req.Context().Node