From 20d0b556ea3499a7e6fc718e49c7c2e4845b1101 Mon Sep 17 00:00:00 2001 From: stephen mcquay Date: Sun, 25 Feb 2018 01:08:57 -0800 Subject: [PATCH] Stubs in keyring subcommand --- cmd/pm/main.go | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 cmd/pm/main.go diff --git a/cmd/pm/main.go b/cmd/pm/main.go new file mode 100644 index 0000000..fe66ae5 --- /dev/null +++ b/cmd/pm/main.go @@ -0,0 +1,30 @@ +package main + +import ( + "fmt" + "os" +) + +const usage = `pm: simple, cross-platform system package manager + +subcommands: + keyring (key) -- interact with pm's OpenPGP keyring +` + +func main() { + if len(os.Args) < 2 { + fatal(usage) + } + cmd := os.Args[1] + + switch cmd { + case "key", "keyring": + default: + fatal("uknown subcommand %q\n\nusage: %v", cmd, usage) + } +} + +func fatal(f string, args ...interface{}) { + fmt.Fprintf(os.Stderr, f, args...) + os.Exit(1) +}