Skip to content

Commit 1c6043d

Browse files
authoredMay 13, 2019
Merge pull request #6318 from ipfs/feat/merge-cmdkit-cmds
cmdkit -> cmds
2 parents 4b7a24f + 5f64b27 commit 1c6043d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+623
-680
lines changed
 

‎README.md

-1
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,6 @@ Listing of the main packages used in the IPFS ecosystem. There are also three sp
353353
| [`go-ipfs-blockstore`](//github.com/ipfs/go-ipfs-blockstore) | [![Travis CI](https://travis-ci.com/ipfs/go-ipfs-blockstore.svg?branch=master)](https://travis-ci.com/ipfs/go-ipfs-blockstore) | [![codecov](https://codecov.io/gh/ipfs/go-ipfs-blockstore/branch/master/graph/badge.svg)](https://codecov.io/gh/ipfs/go-ipfs-blockstore) | blockstore interfaces and implementations |
354354
| **Commands** |
355355
| [`go-ipfs-cmds`](//github.com/ipfs/go-ipfs-cmds) | [![Travis CI](https://travis-ci.com/ipfs/go-ipfs-cmds.svg?branch=master)](https://travis-ci.com/ipfs/go-ipfs-cmds) | [![codecov](https://codecov.io/gh/ipfs/go-ipfs-cmds/branch/master/graph/badge.svg)](https://codecov.io/gh/ipfs/go-ipfs-cmds) | CLI & HTTP commands library |
356-
| [`go-ipfs-cmdkit`](//github.com/ipfs/go-ipfs-cmdkit) | [![Travis CI](https://travis-ci.com/ipfs/go-ipfs-cmdkit.svg?branch=master)](https://travis-ci.com/ipfs/go-ipfs-cmdkit) | [![codecov](https://codecov.io/gh/ipfs/go-ipfs-cmdkit/branch/master/graph/badge.svg)](https://codecov.io/gh/ipfs/go-ipfs-cmdkit) | helper types for the commands library |
357356
| [`go-ipfs-api`](//github.com/ipfs/go-ipfs-api) | [![Travis CI](https://travis-ci.com/ipfs/go-ipfs-api.svg?branch=master)](https://travis-ci.com/ipfs/go-ipfs-api) | [![codecov](https://codecov.io/gh/ipfs/go-ipfs-api/branch/master/graph/badge.svg)](https://codecov.io/gh/ipfs/go-ipfs-api) | a shell for the IPFS HTTP API |
358357
| **Metrics & Logging** |
359358
| [`go-metrics-interface`](//github.com/ipfs/go-metrics-interface) | [![Travis CI](https://travis-ci.com/ipfs/go-metrics-interface.svg?branch=master)](https://travis-ci.com/ipfs/go-metrics-interface) | [![codecov](https://codecov.io/gh/ipfs/go-metrics-interface/branch/master/graph/badge.svg)](https://codecov.io/gh/ipfs/go-metrics-interface) | metrics collection interfaces |

‎cmd/ipfs/daemon.go

+21-22
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ import (
2626
migrate "github.com/ipfs/go-ipfs/repo/fsrepo/migrations"
2727

2828
"github.com/hashicorp/go-multierror"
29-
"github.com/ipfs/go-ipfs-cmdkit"
30-
cmds "github.com/ipfs/go-ipfs-cmds"
29+
"github.com/ipfs/go-ipfs-cmds"
3130
mprome "github.com/ipfs/go-metrics-prometheus"
3231
goprocess "github.com/jbenet/goprocess"
3332
ma "github.com/multiformats/go-multiaddr"
@@ -62,7 +61,7 @@ const (
6261
)
6362

6463
var daemonCmd = &cmds.Command{
65-
Helptext: cmdkit.HelpText{
64+
Helptext: cmds.HelpText{
6665
Tagline: "Run a network-connected IPFS node.",
6766
ShortDescription: `
6867
'ipfs daemon' runs a persistent ipfs daemon that can serve commands
@@ -153,26 +152,26 @@ Headers.
153152
`,
154153
},
155154

156-
Options: []cmdkit.Option{
157-
cmdkit.BoolOption(initOptionKwd, "Initialize ipfs with default settings if not already initialized"),
158-
cmdkit.StringOption(initProfileOptionKwd, "Configuration profiles to apply for --init. See ipfs init --help for more"),
159-
cmdkit.StringOption(routingOptionKwd, "Overrides the routing option").WithDefault(routingOptionDefaultKwd),
160-
cmdkit.BoolOption(mountKwd, "Mounts IPFS to the filesystem"),
161-
cmdkit.BoolOption(writableKwd, "Enable writing objects (with POST, PUT and DELETE)"),
162-
cmdkit.StringOption(ipfsMountKwd, "Path to the mountpoint for IPFS (if using --mount). Defaults to config setting."),
163-
cmdkit.StringOption(ipnsMountKwd, "Path to the mountpoint for IPNS (if using --mount). Defaults to config setting."),
164-
cmdkit.BoolOption(unrestrictedApiAccessKwd, "Allow API access to unlisted hashes"),
165-
cmdkit.BoolOption(unencryptTransportKwd, "Disable transport encryption (for debugging protocols)"),
166-
cmdkit.BoolOption(enableGCKwd, "Enable automatic periodic repo garbage collection"),
167-
cmdkit.BoolOption(adjustFDLimitKwd, "Check and raise file descriptor limits if needed").WithDefault(true),
168-
cmdkit.BoolOption(migrateKwd, "If true, assume yes at the migrate prompt. If false, assume no."),
169-
cmdkit.BoolOption(enablePubSubKwd, "Instantiate the ipfs daemon with the experimental pubsub feature enabled."),
170-
cmdkit.BoolOption(enableIPNSPubSubKwd, "Enable IPNS record distribution through pubsub; enables pubsub."),
171-
cmdkit.BoolOption(enableMultiplexKwd, "Add the experimental 'go-multiplex' stream muxer to libp2p on construction.").WithDefault(true),
155+
Options: []cmds.Option{
156+
cmds.BoolOption(initOptionKwd, "Initialize ipfs with default settings if not already initialized"),
157+
cmds.StringOption(initProfileOptionKwd, "Configuration profiles to apply for --init. See ipfs init --help for more"),
158+
cmds.StringOption(routingOptionKwd, "Overrides the routing option").WithDefault(routingOptionDefaultKwd),
159+
cmds.BoolOption(mountKwd, "Mounts IPFS to the filesystem"),
160+
cmds.BoolOption(writableKwd, "Enable writing objects (with POST, PUT and DELETE)"),
161+
cmds.StringOption(ipfsMountKwd, "Path to the mountpoint for IPFS (if using --mount). Defaults to config setting."),
162+
cmds.StringOption(ipnsMountKwd, "Path to the mountpoint for IPNS (if using --mount). Defaults to config setting."),
163+
cmds.BoolOption(unrestrictedApiAccessKwd, "Allow API access to unlisted hashes"),
164+
cmds.BoolOption(unencryptTransportKwd, "Disable transport encryption (for debugging protocols)"),
165+
cmds.BoolOption(enableGCKwd, "Enable automatic periodic repo garbage collection"),
166+
cmds.BoolOption(adjustFDLimitKwd, "Check and raise file descriptor limits if needed").WithDefault(true),
167+
cmds.BoolOption(migrateKwd, "If true, assume yes at the migrate prompt. If false, assume no."),
168+
cmds.BoolOption(enablePubSubKwd, "Instantiate the ipfs daemon with the experimental pubsub feature enabled."),
169+
cmds.BoolOption(enableIPNSPubSubKwd, "Enable IPNS record distribution through pubsub; enables pubsub."),
170+
cmds.BoolOption(enableMultiplexKwd, "Add the experimental 'go-multiplex' stream muxer to libp2p on construction.").WithDefault(true),
172171

173172
// TODO: add way to override addresses. tricky part: updating the config if also --init.
174-
// cmdkit.StringOption(apiAddrKwd, "Address for the daemon rpc API (overrides config)"),
175-
// cmdkit.StringOption(swarmAddrKwd, "Address for the swarm socket (overrides config)"),
173+
// cmds.StringOption(apiAddrKwd, "Address for the daemon rpc API (overrides config)"),
174+
// cmds.StringOption(swarmAddrKwd, "Address for the swarm socket (overrides config)"),
176175
},
177176
Subcommands: map[string]*cmds.Command{},
178177
Run: daemonFunc,
@@ -384,7 +383,7 @@ func daemonFunc(req *cmds.Request, re cmds.ResponseEmitter, env cmds.Environment
384383
// construct fuse mountpoints - if the user provided the --mount flag
385384
mount, _ := req.Options[mountKwd].(bool)
386385
if mount && offline {
387-
return cmdkit.Errorf(cmdkit.ErrClient, "mount is not currently supported in offline mode")
386+
return cmds.Errorf(cmds.ErrClient, "mount is not currently supported in offline mode")
388387
}
389388
if mount {
390389
if err := mountFuse(req, cctx); err != nil {

0 commit comments

Comments
 (0)
Please sign in to comment.