diff options
Diffstat (limited to 'cmd/overwrite.go')
-rw-r--r-- | cmd/overwrite.go | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/cmd/overwrite.go b/cmd/overwrite.go new file mode 100644 index 0000000..6f4a00b --- /dev/null +++ b/cmd/overwrite.go @@ -0,0 +1,21 @@ +package cmd + +import ( + "flag" + "fmt" +) + +func Overwrite(params [] string) { + flags := flag.NewFlagSet("overwrite", flag.ExitOnError); + + var withBackup bool + + const WITH_BACKUP_HELP = "backup the file by creating a snapshot" + + flags.BoolVar(&withBackup, "backup", false, WITH_BACKUP_HELP); + flags.BoolVar(&withBackup, "b", false, WITH_BACKUP_HELP); + + flags.Parse(params); + + fmt.Printf("Your flag is: %t", withBackup); +}
\ No newline at end of file |