File: del.go

package info (click to toggle)
golang-doozer 0.0~git20130909-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 224 kB
  • ctags: 283
  • sloc: makefile: 11
file content (21 lines) | stat: -rw-r--r-- 362 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package main

func init() {
	cmds["del"] = cmd{del, "<path> <rev>", "delete a file"}
	cmdHelp["del"] = `Deletes the file at <path>.

If <rev> is not greater than or equal to the revision of the file,
no change will be made.
`
}

func del(path, rev string) {
	oldRev := mustAtoi64(rev)

	c := dial()

	err := c.Del(path, oldRev)
	if err != nil {
		bail(err)
	}
}