Skip to content

Commit d4ce5f0

Browse files
committed
Merge pull request #2679 from ipfs/feature/add-default-false
Added Default false to all remaining options
2 parents efc6231 + b01c3f5 commit d4ce5f0

File tree

5 files changed

+15
-15
lines changed

5 files changed

+15
-15
lines changed

core/commands/repo.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ order to reclaim hard disk space.
3838
`,
3939
},
4040
Options: []cmds.Option{
41-
cmds.BoolOption("quiet", "q", "Write minimal output."),
41+
cmds.BoolOption("quiet", "q", "Write minimal output.").Default(false),
4242
},
4343
Run: func(req cmds.Request, res cmds.Response) {
4444
n, err := req.InvocContext().GetNode()
@@ -127,7 +127,7 @@ RepoSize int Size in bytes that the repo is currently taking.
127127
res.SetOutput(stat)
128128
},
129129
Options: []cmds.Option{
130-
cmds.BoolOption("human", "Output RepoSize in MiB."),
130+
cmds.BoolOption("human", "Output RepoSize in MiB.").Default(false),
131131
},
132132
Type: corerepo.Stat{},
133133
Marshalers: cmds.MarshalerMap{

core/commands/resolve.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Resolve the value of an IPFS DAG path:
5959
cmds.StringArg("name", true, false, "The name to resolve.").EnableStdin(),
6060
},
6161
Options: []cmds.Option{
62-
cmds.BoolOption("recursive", "r", "Resolve until the result is an IPFS name. Default: false."),
62+
cmds.BoolOption("recursive", "r", "Resolve until the result is an IPFS name.").Default(false),
6363
},
6464
Run: func(req cmds.Request, res cmds.Response) {
6565

core/commands/root.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ at ~/.ipfs. To change the repo location, set the $IPFS_PATH environment variable
7070
},
7171
Options: []cmds.Option{
7272
cmds.StringOption("config", "c", "Path to the configuration file to use."),
73-
cmds.BoolOption("debug", "D", "Operate in debug mode."),
74-
cmds.BoolOption("help", "Show the full command help text."),
75-
cmds.BoolOption("h", "Show a short version of the command help text."),
76-
cmds.BoolOption("local", "L", "Run the command locally, instead of using the daemon."),
73+
cmds.BoolOption("debug", "D", "Operate in debug mode.").Default(false),
74+
cmds.BoolOption("help", "Show the full command help text.").Default(false),
75+
cmds.BoolOption("h", "Show a short version of the command help text.").Default(false),
76+
cmds.BoolOption("local", "L", "Run the command locally, instead of using the daemon.").Default(false),
7777
cmds.StringOption(ApiOption, "Use a specific API instance (defaults to /ip4/127.0.0.1/tcp/5001)"),
7878
},
7979
}

core/commands/swarm.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ var swarmAddrsLocalCmd = &cmds.Command{
152152
`,
153153
},
154154
Options: []cmds.Option{
155-
cmds.BoolOption("id", "Show peer ID in addresses."),
155+
cmds.BoolOption("id", "Show peer ID in addresses.").Default(false),
156156
},
157157
Run: func(req cmds.Request, res cmds.Response) {
158158

core/commands/version.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ var VersionCmd = &cmds.Command{
2323
},
2424

2525
Options: []cmds.Option{
26-
cmds.BoolOption("number", "n", "Only show the version number."),
27-
cmds.BoolOption("commit", "Show the commit hash."),
28-
cmds.BoolOption("repo", "Show repo version."),
26+
cmds.BoolOption("number", "n", "Only show the version number.").Default(false),
27+
cmds.BoolOption("commit", "Show the commit hash.").Default(false),
28+
cmds.BoolOption("repo", "Show repo version.").Default(false),
2929
},
3030
Run: func(req cmds.Request, res cmds.Response) {
3131
res.SetOutput(&VersionOutput{
@@ -47,20 +47,20 @@ var VersionCmd = &cmds.Command{
4747
return strings.NewReader(v.Repo + "\n"), nil
4848
}
4949

50-
commit, found, err := res.Request().Option("commit").Bool()
50+
commit, _, err := res.Request().Option("commit").Bool()
5151
commitTxt := ""
5252
if err != nil {
5353
return nil, err
5454
}
55-
if found && commit {
55+
if commit {
5656
commitTxt = "-" + v.Commit
5757
}
5858

59-
number, found, err := res.Request().Option("number").Bool()
59+
number, _, err := res.Request().Option("number").Bool()
6060
if err != nil {
6161
return nil, err
6262
}
63-
if found && number {
63+
if number {
6464
return strings.NewReader(fmt.Sprintln(v.Version + commitTxt)), nil
6565
}
6666

0 commit comments

Comments
 (0)