Skip to content

Commit

Permalink
Merge pull request #3167 from ipfs/feat/add-default-to-files
Browse files Browse the repository at this point in the history
Add default True to files flush
  • Loading branch information
whyrusleeping committed Sep 4, 2016
2 parents bb7dc61 + 1a6784e commit 0f0cf44
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions core/commands/files/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ operations.
`,
},
Options: []cmds.Option{
cmds.BoolOption("flush", "f", "Flush target and ancestors after write. Default: true."),
cmds.BoolOption("f", "flush", "Flush target and ancestors after write.").Default(true),
},
Subcommands: map[string]*cmds.Command{
"read": FilesReadCmd,
Expand Down Expand Up @@ -207,10 +207,7 @@ var FilesCpCmd = &cmds.Command{
return
}

flush, found, _ := req.Option("flush").Bool()
if !found {
flush = true
}
flush, _, _ := req.Option("flush").Bool()

src, err := checkPath(req.Arguments()[0])
if err != nil {
Expand Down Expand Up @@ -585,10 +582,7 @@ stat' on the file or any of its ancestors.

create, _, _ := req.Option("create").Bool()
trunc, _, _ := req.Option("truncate").Bool()
flush, fset, _ := req.Option("flush").Bool()
if !fset {
flush = true
}
flush, _, _ := req.Option("flush").Bool()

nd, err := req.InvocContext().GetNode()
if err != nil {
Expand Down Expand Up @@ -700,10 +694,7 @@ Examples:
return
}

flush, found, _ := req.Option("flush").Bool()
if !found {
flush = true
}
flush, _, _ := req.Option("flush").Bool()

err = mfs.Mkdir(n.FilesRoot, dirtomake, dashp, flush)
if err != nil {
Expand Down

0 comments on commit 0f0cf44

Please sign in to comment.