File: rm.go

package info (click to toggle)
golang-github-svent-go-flags 1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 224 kB
  • ctags: 186
  • sloc: sh: 13; makefile: 7
file content (23 lines) | stat: -rw-r--r-- 444 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package main

import (
	"fmt"
)

type RmCommand struct {
	Force bool `short:"f" long:"force" description:"Force removal of files"`
}

var rmCommand RmCommand

func (x *RmCommand) Execute(args []string) error {
	fmt.Printf("Removing (force=%v): %#v\n", x.Force, args)
	return nil
}

func init() {
	parser.AddCommand("rm",
		"Remove a file",
		"The rm command removes a file to the repository. Use -f to force removal of files.",
		&rmCommand)
}