From 7f61030eb52693203389f2e38cb0525546ab1be9 Mon Sep 17 00:00:00 2001 From: Richard Littauer Date: Wed, 1 Jun 2016 16:44:29 +0100 Subject: [PATCH] All commands: Align to under 78-ruler width This is just for the description, for now. License: MIT Signed-off-by: Richard Littauer --- cmd/ipfs/daemon.go | 10 ++++++---- cmd/ipfs/init.go | 5 +++-- core/commands/dht.go | 18 ++++++++++++++---- core/commands/files/files.go | 10 +++++----- core/commands/get.go | 4 ++-- core/commands/ls.go | 3 ++- core/commands/object/object.go | 18 ++++++++---------- core/commands/object/patch.go | 4 ++-- core/commands/pin.go | 19 +++++++++++++------ core/commands/stat.go | 7 +++++-- core/commands/swarm.go | 14 ++++++++------ core/commands/tar.go | 3 ++- 12 files changed, 70 insertions(+), 45 deletions(-) diff --git a/cmd/ipfs/daemon.go b/cmd/ipfs/daemon.go index 3720aa20549..c6928422f85 100644 --- a/cmd/ipfs/daemon.go +++ b/cmd/ipfs/daemon.go @@ -110,8 +110,9 @@ second signal. IPFS_PATH environment variable -ipfs uses a repository in the local file system. By default, the repo is located -at ~/.ipfs. To change the repo location, set the $IPFS_PATH environment variable: +ipfs uses a repository in the local file system. By default, the repo is +located at ~/.ipfs. To change the repo location, set the $IPFS_PATH +environment variable: export IPFS_PATH=/path/to/ipfsrepo @@ -121,8 +122,9 @@ Previously, IPFS used an environment variable as seen below: export API_ORIGIN="http://localhost:8888/" -This is deprecated. It is still honored in this version, but will be removed in a -future version, along with this notice. Please move to setting the HTTP Headers. +This is deprecated. It is still honored in this version, but will be removed +in a future version, along with this notice. Please move to setting the HTTP +Headers. `, }, diff --git a/cmd/ipfs/init.go b/cmd/ipfs/init.go index f9ef237270c..2492268a730 100644 --- a/cmd/ipfs/init.go +++ b/cmd/ipfs/init.go @@ -26,8 +26,9 @@ var initCmd = &cmds.Command{ ShortDescription: ` Initializes IPFS configuration files and generates a new keypair. -ipfs uses a repository in the local file system. By default, the repo is located -at ~/.ipfs. To change the repo location, set the $IPFS_PATH environment variable: +ipfs uses a repository in the local file system. By default, the repo is +located at ~/.ipfs. To change the repo location, set the $IPFS_PATH +environment variable: export IPFS_PATH=/path/to/ipfsrepo `, diff --git a/core/commands/dht.go b/core/commands/dht.go index 6183ae6db2a..cdbbb4e4713 100644 --- a/core/commands/dht.go +++ b/core/commands/dht.go @@ -331,7 +331,11 @@ var getValueDhtCmd = &cmds.Command{ ShortDescription: ` Outputs the best value for the given key. -There may be several different values for a given key stored in the DHT; in this context 'best' means the record that is most desirable. There is no one metric for 'best': it depends entirely on the key type. For IPNS, 'best' is the record that is both valid and has the highest sequence number (freshest). Different key types can specify other 'best' rules. +There may be several different values for a given key stored in the DHT; in +this context 'best' means the record that is most desirable. There is no one +metric for 'best': it depends entirely on the key type. For IPNS, 'best' is +the record that is both valid and has the highest sequence number (freshest). +Different key types can specify other 'best' rules. `, }, @@ -434,11 +438,17 @@ var putValueDhtCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Write a key/value pair to the DHT.", ShortDescription: ` -Given a key of the form /foo/bar and a value of any form, this will write that value to the DHT with that key. +Given a key of the form /foo/bar and a value of any form, this will write that +value to the DHT with that key. -Keys have two parts: a keytype (foo) and the key name (bar). IPNS uses the /ipns keytype, and expects the key name to be a Peer ID. IPNS entries are specifically formatted (protocol buffer). +Keys have two parts: a keytype (foo) and the key name (bar). IPNS uses the +/ipns keytype, and expects the key name to be a Peer ID. IPNS entries are +specifically formatted (protocol buffer). -You may only use keytypes that are supported in your ipfs binary: currently this is only /ipns. Unless you have a relatively deep understanding of the go-ipfs DHT internals, you likely want to be using 'ipfs name publish' instead of this. +You may only use keytypes that are supported in your ipfs binary: currently +this is only /ipns. Unless you have a relatively deep understanding of the +go-ipfs DHT internals, you likely want to be using 'ipfs name publish' instead +of this. Value is arbitrary text. Standard input can be used to provide value. diff --git a/core/commands/files/files.go b/core/commands/files/files.go index c524a98664b..b8e0b392f3c 100644 --- a/core/commands/files/files.go +++ b/core/commands/files/files.go @@ -381,8 +381,8 @@ var FilesReadCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Read a file in a given mfs.", ShortDescription: ` -Read a specified number of bytes from a file at a given offset. By default, will -read the entire file similar to unix cat. +Read a specified number of bytes from a file at a given offset. By default, +will read the entire file similar to unix cat. Examples: @@ -553,9 +553,9 @@ EXAMPLE: WARNING: - Usage of the '--flush=false' option does not guarantee data durability until - the tree has been flushed. This can be accomplished by running 'ipfs files stat' - on the file or any of its ancestors. +Usage of the '--flush=false' option does not guarantee data durability until +the tree has been flushed. This can be accomplished by running 'ipfs files +stat' on the file or any of its ancestors. `, }, Arguments: []cmds.Argument{ diff --git a/core/commands/get.go b/core/commands/get.go index 08c76121e4a..406c6281643 100644 --- a/core/commands/get.go +++ b/core/commands/get.go @@ -26,8 +26,8 @@ var GetCmd = &cmds.Command{ ShortDescription: ` Stores to disk the data contained an IPFS or IPNS object(s) at the given path. -By default, the output will be stored at './', but an alternate path -can be specified with '--output=' or '-o='. +By default, the output will be stored at './', but an alternate +path can be specified with '--output=' or '-o='. To output a TAR archive instead of unpacked files, use '--archive' or '-a'. diff --git a/core/commands/ls.go b/core/commands/ls.go index 9604a1d2d91..979a93081cc 100644 --- a/core/commands/ls.go +++ b/core/commands/ls.go @@ -33,7 +33,8 @@ var LsCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "List links from an object.", ShortDescription: ` -Displays the links an IPFS or IPNS object(s) contains, with the following format: +Displays the links an IPFS or IPNS object(s) contains, with the following +format: `, diff --git a/core/commands/object/object.go b/core/commands/object/object.go index e0a56c6181a..5c9ed3b4e37 100644 --- a/core/commands/object/object.go +++ b/core/commands/object/object.go @@ -65,17 +65,15 @@ var ObjectDataCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Outputs the raw bytes in an IPFS object.", ShortDescription: ` -'ipfs object data' is a plumbing command for retrieving the raw bytes stored in -a DAG node. It outputs to stdout, and is a base58 encoded -multihash. +'ipfs object data' is a plumbing command for retrieving the raw bytes stored +in a DAG node. It outputs to stdout, and is a base58 encoded multihash. `, LongDescription: ` -'ipfs object data' is a plumbing command for retrieving the raw bytes stored in -a DAG node. It outputs to stdout, and is a base58 encoded -multihash. +'ipfs object data' is a plumbing command for retrieving the raw bytes stored +in a DAG node. It outputs to stdout, and is a base58 encoded multihash. -Note that the "--encoding" option does not affect the output, since the -output is the raw data of the object. +Note that the "--encoding" option does not affect the output, since the output +is the raw data of the object. `, }, @@ -313,8 +311,8 @@ Examples: $ echo '{ "Data": "abc" }' | ipfs object put -This creates a node with the data 'abc' and no links. For an object with links, -create a file named 'node.json' with the contents: +This creates a node with the data 'abc' and no links. For an object with +links, create a file named 'node.json' with the contents: { "Data": "another", diff --git a/core/commands/object/patch.go b/core/commands/object/patch.go index f100f1862d7..1fe1f4d5853 100644 --- a/core/commands/object/patch.go +++ b/core/commands/object/patch.go @@ -241,8 +241,8 @@ Example: $ BAR=$(echo "bar" | ipfs add -q) $ ipfs object patch $EMPTY_DIR add-link foo $BAR -This takes an empty directory, and adds a link named 'foo' under it, pointing to -a file containing 'bar', and returns the hash of the new object. +This takes an empty directory, and adds a link named 'foo' under it, pointing +to a file containing 'bar', and returns the hash of the new object. `, }, Arguments: []cmds.Argument{ diff --git a/core/commands/pin.go b/core/commands/pin.go index 1b902ebbc82..934c9a39dcb 100644 --- a/core/commands/pin.go +++ b/core/commands/pin.go @@ -152,20 +152,27 @@ var listPinCmd = &cmds.Command{ Tagline: "List objects pinned to local storage.", ShortDescription: ` Returns a list of objects that are pinned locally. -By default, all pinned objects are returned, but the '--type' flag or arguments can restrict that to a specific pin type or to some specific objects respectively. +By default, all pinned objects are returned, but the '--type' flag or +arguments can restrict that to a specific pin type or to some specific objects +respectively. `, LongDescription: ` Returns a list of objects that are pinned locally. -By default, all pinned objects are returned, but the '--type' flag or arguments can restrict that to a specific pin type or to some specific objects respectively. +By default, all pinned objects are returned, but the '--type' flag or +arguments can restrict that to a specific pin type or to some specific objects +respectively. -Use --type= to specify the type of pinned keys to list. Valid values are: +Use --type= to specify the type of pinned keys to list. +Valid values are: * "direct": pin that specific object. - * "recursive": pin that specific object, and indirectly pin all its decendants + * "recursive": pin that specific object, and indirectly pin all its + descendants * "indirect": pinned indirectly by an ancestor (like a refcount) * "all" -With arguments, the command fails if any of the arguments is not a pinned object. -And if --type= is additionally used, the command will also fail if any of the arguments is not of the specified type. +With arguments, the command fails if any of the arguments is not a pinned +object. And if --type= is additionally used, the command will also fail +if any of the arguments is not of the specified type. Example: $ echo "hello" | ipfs add -q diff --git a/core/commands/stat.go b/core/commands/stat.go index 93f01bddd24..9ffbbd7cfc7 100644 --- a/core/commands/stat.go +++ b/core/commands/stat.go @@ -20,8 +20,11 @@ var StatsCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Query ipfs statistics.", Synopsis: "ipfs stats ", - ShortDescription: `'ipfs stats' is a set of commands to help look at statistics for your ipfs node.`, - LongDescription: `'ipfs stats' is a set of commands to help look at statistics for your ipfs node.`, + ShortDescription: `'ipfs stats' is a set of commands to help look at statistics +for your ipfs node. +`, + LongDescription: `'ipfs stats' is a set of commands to help look at statistics +for your ipfs node.`, }, Subcommands: map[string]*cmds.Command{ diff --git a/core/commands/swarm.go b/core/commands/swarm.go index 039af0ebfe0..a48a54c3d99 100644 --- a/core/commands/swarm.go +++ b/core/commands/swarm.go @@ -260,12 +260,13 @@ var swarmDisconnectCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Close connection to a given address.", ShortDescription: ` -'ipfs swarm disconnect' closes a connection to a peer address. The address format -is an ipfs multiaddr: +'ipfs swarm disconnect' closes a connection to a peer address. The address +format is an ipfs multiaddr: ipfs swarm disconnect /ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ -The disconnect is not permanent; if ipfs needs to talk to that address later, it will reconnect. +The disconnect is not permanent; if ipfs needs to talk to that address later, +it will reconnect. `, }, Arguments: []cmds.Argument{ @@ -373,10 +374,11 @@ var swarmFiltersCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Manipulate address filters.", ShortDescription: ` -'ipfs swarm filters' will list out currently applied filters. Its subcommands can be used -to add or remove said filters. Filters are specified using the multiaddr-filter format: +'ipfs swarm filters' will list out currently applied filters. Its subcommands +can be used to add or remove said filters. Filters are specified using the +multiaddr-filter format: -example: +Example: /ip4/192.168.0.0/ipcidr/16 diff --git a/core/commands/tar.go b/core/commands/tar.go index dfd0d36ff38..0744781841d 100644 --- a/core/commands/tar.go +++ b/core/commands/tar.go @@ -26,7 +26,8 @@ var tarAddCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Import a tar file into ipfs.", ShortDescription: ` -'ipfs tar add' will parse a tar file and create a merkledag structure to represent it. +'ipfs tar add' will parse a tar file and create a merkledag structure to +represent it. `, },