From 1a6784e070ae32a36a0b124c78bbfed66c4fd274 Mon Sep 17 00:00:00 2001 From: Richard Littauer Date: Thu, 1 Sep 2016 11:47:15 -0400 Subject: [PATCH] Add default True to files flush License: MIT Signed-off-by: Richard Littauer --- core/commands/files/files.go | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/core/commands/files/files.go b/core/commands/files/files.go index 6e471e991..d869bffd3 100644 --- a/core/commands/files/files.go +++ b/core/commands/files/files.go @@ -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, @@ -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 { @@ -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 { @@ -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 {