diff --git a/core/commands/repo.go b/core/commands/repo.go index 5f05128cd..0fdcf0106 100644 --- a/core/commands/repo.go +++ b/core/commands/repo.go @@ -38,7 +38,7 @@ order to reclaim hard disk space. `, }, Options: []cmds.Option{ - cmds.BoolOption("quiet", "q", "Write minimal output."), + cmds.BoolOption("quiet", "q", "Write minimal output.").Default(false), }, Run: func(req cmds.Request, res cmds.Response) { n, err := req.InvocContext().GetNode() @@ -127,7 +127,7 @@ RepoSize int Size in bytes that the repo is currently taking. res.SetOutput(stat) }, Options: []cmds.Option{ - cmds.BoolOption("human", "Output RepoSize in MiB."), + cmds.BoolOption("human", "Output RepoSize in MiB.").Default(false), }, Type: corerepo.Stat{}, Marshalers: cmds.MarshalerMap{ diff --git a/core/commands/resolve.go b/core/commands/resolve.go index eca4ca0cc..692141a57 100644 --- a/core/commands/resolve.go +++ b/core/commands/resolve.go @@ -59,7 +59,7 @@ Resolve the value of an IPFS DAG path: cmds.StringArg("name", true, false, "The name to resolve.").EnableStdin(), }, Options: []cmds.Option{ - cmds.BoolOption("recursive", "r", "Resolve until the result is an IPFS name. Default: false."), + cmds.BoolOption("recursive", "r", "Resolve until the result is an IPFS name.").Default(false), }, Run: func(req cmds.Request, res cmds.Response) { diff --git a/core/commands/root.go b/core/commands/root.go index 6b7ee3a59..bbdc806fb 100644 --- a/core/commands/root.go +++ b/core/commands/root.go @@ -70,10 +70,10 @@ at ~/.ipfs. To change the repo location, set the $IPFS_PATH environment variable }, Options: []cmds.Option{ cmds.StringOption("config", "c", "Path to the configuration file to use."), - cmds.BoolOption("debug", "D", "Operate in debug mode."), - cmds.BoolOption("help", "Show the full command help text."), - cmds.BoolOption("h", "Show a short version of the command help text."), - cmds.BoolOption("local", "L", "Run the command locally, instead of using the daemon."), + cmds.BoolOption("debug", "D", "Operate in debug mode.").Default(false), + cmds.BoolOption("help", "Show the full command help text.").Default(false), + cmds.BoolOption("h", "Show a short version of the command help text.").Default(false), + cmds.BoolOption("local", "L", "Run the command locally, instead of using the daemon.").Default(false), cmds.StringOption(ApiOption, "Use a specific API instance (defaults to /ip4/127.0.0.1/tcp/5001)"), }, } diff --git a/core/commands/swarm.go b/core/commands/swarm.go index 541e6e3d1..c9473a9cb 100644 --- a/core/commands/swarm.go +++ b/core/commands/swarm.go @@ -152,7 +152,7 @@ var swarmAddrsLocalCmd = &cmds.Command{ `, }, Options: []cmds.Option{ - cmds.BoolOption("id", "Show peer ID in addresses."), + cmds.BoolOption("id", "Show peer ID in addresses.").Default(false), }, Run: func(req cmds.Request, res cmds.Response) { diff --git a/core/commands/version.go b/core/commands/version.go index c8d3212e2..0f9a611ee 100644 --- a/core/commands/version.go +++ b/core/commands/version.go @@ -23,9 +23,9 @@ var VersionCmd = &cmds.Command{ }, Options: []cmds.Option{ - cmds.BoolOption("number", "n", "Only show the version number."), - cmds.BoolOption("commit", "Show the commit hash."), - cmds.BoolOption("repo", "Show repo version."), + cmds.BoolOption("number", "n", "Only show the version number.").Default(false), + cmds.BoolOption("commit", "Show the commit hash.").Default(false), + cmds.BoolOption("repo", "Show repo version.").Default(false), }, Run: func(req cmds.Request, res cmds.Response) { res.SetOutput(&VersionOutput{ @@ -47,20 +47,20 @@ var VersionCmd = &cmds.Command{ return strings.NewReader(v.Repo + "\n"), nil } - commit, found, err := res.Request().Option("commit").Bool() + commit, _, err := res.Request().Option("commit").Bool() commitTxt := "" if err != nil { return nil, err } - if found && commit { + if commit { commitTxt = "-" + v.Commit } - number, found, err := res.Request().Option("number").Bool() + number, _, err := res.Request().Option("number").Bool() if err != nil { return nil, err } - if found && number { + if number { return strings.NewReader(fmt.Sprintln(v.Version + commitTxt)), nil }