mkdir: Return status added.
This commit is contained in:
parent
d74cd0b6ef
commit
0cbb8be7f7
1 changed files with 4 additions and 1 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue