Skip to content
Browse files

add a list command to cm

  • Loading branch information...
1 parent 1f23563 commit 4c9ef0b9afdf061a371414f9417063ee5d94c6e1 @jmoiron committed Mar 10, 2013
Showing with 8 additions and 3 deletions.
  1. +1 −3 README → README.md
  2. +6 −0 cm.go
  3. +1 −0 commands.go
View
4 README → README.md
@@ -15,6 +15,7 @@ by a command and then arguments related to that command:
add <file> - add a file to management directory
rm <file> - remove file from management directory
show - show what files, if any, are added under cm
+ list - list all files under cm
diff [file] - show diff between files under cm
sync [all] - sync cm overlay to cwd, or / if "all"
pkg [subcmd...] - package management subcommand
@@ -29,6 +30,3 @@ subcommands:
pkg diff [name] - show diff between list and installed, matching optional name
pkg show [name] - show packages and install status, matching optional name
-cm is written in golang, and if you have a build environment setup, you can install
-cm w/ `go get github.com/jmoiron/cm`
-
View
6 cm.go
@@ -20,6 +20,7 @@ by a command and then arguments related to that command:
add <file> - add a file to management directory
rm <file> - remove file from management directory
show - show what files, if any, are added under cm
+ list - list all files under cm
diff [file] - show diff between files under cm
sync [all] - sync cm overlay to cwd, or / if "all"
pkg [subcmd...] - package management subcommand
@@ -129,6 +130,11 @@ func main() {
fmt.Fprintf(os.Stderr, "Error (Show): %s\n", err.Error())
}
}
+ case "list":
+ err := Show("/")
+ if err != nil {
+ fmt.Fprintf(os.Stderr, "Error (List): %s\n", err.Error())
+ }
case "sync", "update":
for _, arg := range args {
err := Sync(arg)
View
1 commands.go
@@ -82,6 +82,7 @@ func Rm(path string) error {
dst := C(abs)
err = os.RemoveAll(dst)
+ println(abs, dst)
if err == nil {
fmt.Printf("Removed %s\n", abs)
} else {

0 comments on commit 4c9ef0b

Please sign in to comment.
Something went wrong with that request. Please try again.