mkdir: Return status added.

This commit is contained in:
jienfak 2019-09-28 18:03:39 +05:00
parent d74cd0b6ef
commit 0cbb8be7f7

View file

@ -9,8 +9,9 @@ import(
func main() {
var (
parentFlag, verbFlag bool
modeArg int
modeArg int
)
status := 0
flag.BoolVar(&parentFlag, "p", false, "No error if existing, make parent as needed.")
flag.IntVar(&modeArg, "m", 0766, "Set file `mode`.")
flag.BoolVar(&verbFlag, "v", false, "Print a message for each created directory.")
@ -33,8 +34,10 @@ func main() {
}
if err != nil {
warn.Println(err)
status = 1
} else if verbFlag {
verb.Printf("Created directory '%s'.", path)
}
}
os.Exit(status)
}