rm.go 444 B

1234567891011121314151617181920212223
  1. package main
  2. import (
  3. "fmt"
  4. )
  5. type RmCommand struct {
  6. Force bool `short:"f" long:"force" description:"Force removal of files"`
  7. }
  8. var rmCommand RmCommand
  9. func (x *RmCommand) Execute(args []string) error {
  10. fmt.Printf("Removing (force=%v): %#v\n", x.Force, args)
  11. return nil
  12. }
  13. func init() {
  14. parser.AddCommand("rm",
  15. "Remove a file",
  16. "The rm command removes a file to the repository. Use -f to force removal of files.",
  17. &rmCommand)
  18. }