diff options
author | Ben Burwell <ben@benburwell.com> | 2020-06-06 17:02:38 -0400 |
---|---|---|
committer | Ben Burwell <ben@benburwell.com> | 2020-06-06 17:02:38 -0400 |
commit | da8aa52b5ce6d948a346d7dbf1254ca3faaeac80 (patch) | |
tree | 503ed27704aab39c824abcbd8a08d4f60fb39e49 /status.go | |
parent | 34060154caf34fc8d709135be803e08855496614 (diff) |
Add status subcommandstatus
Diffstat (limited to 'status.go')
-rw-r--r-- | status.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/status.go b/status.go new file mode 100644 index 0000000..b9c7aa1 --- /dev/null +++ b/status.go @@ -0,0 +1,30 @@ +package main + +import ( + "fmt" +) + +func status(conf *Conf, args []string) error { + if len(args) != 0 { + return statusFiles(conf, args) + } + names, err := conf.FileNames() + if err != nil { + return err + } + return statusFiles(conf, names) +} + +func statusFiles(conf *Conf, names []string) error { + for _, name := range names { + if err := statusFile(conf, name); err != nil { + return fmt.Errorf("could not check status of %s: %v", name, err) + } + } + return nil +} + +func statusFile(conf *Conf, name string) error { + fmt.Printf("%s: OK\n", name) + return nil +} |