File: add.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 (20 lines) | stat: -rw-r--r-- 427 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package main

func init() {
	cmds["add"] = cmd{add, "<path>", "add a key only if it isn't already set"}
	cmdHelp["add"] = `Sets the body of the file located at <path> only if it didn't already exist.

Equivalent to

  set <path> 0

The body is read from stdin. If the file already exists,
no change will be made.

Prints the new revision on stdout, or an error message on stderr.
`
}

func add(path string) {
	set(path, "0")
}