Stub out install subcommand
This commit is contained in:
parent
bc8a4a1905
commit
b869bd250c
@ -21,6 +21,7 @@ const usage = `pm: simple, cross-platform system package manager
|
|||||||
subcommands:
|
subcommands:
|
||||||
available (av) -- print out all installable packages
|
available (av) -- print out all installable packages
|
||||||
environ (env) -- print environment information
|
environ (env) -- print environment information
|
||||||
|
install (in) -- install packages
|
||||||
keyring (key) -- interact with pm's OpenPGP keyring
|
keyring (key) -- interact with pm's OpenPGP keyring
|
||||||
package (pkg) -- create packages
|
package (pkg) -- create packages
|
||||||
pull -- fetch all available packages from all configured remotes
|
pull -- fetch all available packages from all configured remotes
|
||||||
@ -223,6 +224,14 @@ func main() {
|
|||||||
if err := db.ListAvailable(root, os.Stdout); err != nil {
|
if err := db.ListAvailable(root, os.Stdout); err != nil {
|
||||||
fatalf("pulling available packages: %v\n", err)
|
fatalf("pulling available packages: %v\n", err)
|
||||||
}
|
}
|
||||||
|
case "install", "in":
|
||||||
|
if len(os.Args[1:]) < 2 {
|
||||||
|
fatalf("pm install: insufficient args\n\nusage: pm install [pkg1, pkg2, ..., pkgN]\n")
|
||||||
|
}
|
||||||
|
pkgs := os.Args[2:]
|
||||||
|
if err := pkg.Install(root, pkgs); err != nil {
|
||||||
|
fatalf("installing: %v\n", err)
|
||||||
|
}
|
||||||
case "version", "v":
|
case "version", "v":
|
||||||
fmt.Printf("pm: version %v\n", Version)
|
fmt.Printf("pm: version %v\n", Version)
|
||||||
default:
|
default:
|
||||||
|
10
pkg/install.go
Normal file
10
pkg/install.go
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package pkg
|
||||||
|
|
||||||
|
import (
|
||||||
|
"github.com/pkg/errors"
|
||||||
|
)
|
||||||
|
|
||||||
|
// Install fetches and installs pkgs from appropriate remotes.
|
||||||
|
func Install(root string, pkgs []string) error {
|
||||||
|
return errors.New("NYI")
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user