Adds env subcommand
This commit is contained in:
parent
5495f69b5a
commit
280ba234c8
@ -8,6 +8,7 @@ import (
|
|||||||
const usage = `pm: simple, cross-platform system package manager
|
const usage = `pm: simple, cross-platform system package manager
|
||||||
|
|
||||||
subcommands:
|
subcommands:
|
||||||
|
environ (env) -- print environment information
|
||||||
keyring (key) -- interact with pm's OpenPGP keyring
|
keyring (key) -- interact with pm's OpenPGP keyring
|
||||||
`
|
`
|
||||||
|
|
||||||
@ -23,7 +24,14 @@ func main() {
|
|||||||
}
|
}
|
||||||
cmd := os.Args[1]
|
cmd := os.Args[1]
|
||||||
|
|
||||||
|
root := os.Getenv("PM_ROOT")
|
||||||
|
if root == "" {
|
||||||
|
root = "/usr/local"
|
||||||
|
}
|
||||||
|
|
||||||
switch cmd {
|
switch cmd {
|
||||||
|
case "env", "environ":
|
||||||
|
fmt.Printf("PM_ROOT=%q\n", root)
|
||||||
case "key", "keyring":
|
case "key", "keyring":
|
||||||
if len(os.Args[1:]) < 2 {
|
if len(os.Args[1:]) < 2 {
|
||||||
fatalf("pm keyring: insufficient args\n\nusage: %v", keyUsage)
|
fatalf("pm keyring: insufficient args\n\nusage: %v", keyUsage)
|
||||||
|
Loading…
Reference in New Issue
Block a user