feat: do nothing without force flag
This commit is contained in:
parent
48b1493696
commit
40265a41fc
5
main.go
5
main.go
@ -15,6 +15,7 @@ var execCmd string
|
||||
|
||||
func main() {
|
||||
flag.BoolVar(&dryrun, "n", false, "Show what would have been done.")
|
||||
force := flag.Bool("force", false, "Actually rename files.")
|
||||
flag.StringVar(&execCmd, "exec", "", "Run command on matching file.")
|
||||
path := flag.String("path", ".", "Handle files in path.")
|
||||
flag.Parse()
|
||||
@ -24,8 +25,8 @@ func main() {
|
||||
return
|
||||
}
|
||||
|
||||
if !dryrun {
|
||||
panic("please dry run first")
|
||||
if !dryrun && !*force {
|
||||
panic("please dry run first or use the force flag to actually rename files")
|
||||
}
|
||||
|
||||
switch flag.Arg(0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user