diff --git a/README.md b/README.md index f54e8e6..5781394 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ If you already have Go, Qemu and Docker installed, there's cross-platform instal $ rm -rf {Debian,CentOS,Ubuntu/{14.04,18.04}} # speed up :) $ ./bootstrap.sh $ # wait several hours... - $ export OUT_OF_TREE_KERNELS_CONFIG=$GOPATH/src/github.com/jollheef/out-of-tree/tools/kernel-factory/output/kernels.toml + $ export OUT_OF_TREE_KCFG=$GOPATH/src/github.com/jollheef/out-of-tree/tools/kernel-factory/output/kernels.toml $ cd ../../examples/kernel-exploit $ # test kernel exploit $ out-of-tree pew diff --git a/main.go b/main.go index 2711f87..d74b936 100644 --- a/main.go +++ b/main.go @@ -429,17 +429,18 @@ func pewHandler(workPath, kcfgPath string) (err error) { } func main() { - pewCommand := kingpin.Command("pew", "Build, run and test module/exploit") - path := pewCommand.Arg( - "path", "Path to work directory").Default(".").ExistingDir() - kernelsConfig := pewCommand.Flag( - "kernels-config", "Path to kernels config").Envar( - "OUT_OF_TREE_KERNELS_CONFIG").Required().ExistingFile() + pathFlag := kingpin.Flag("path", "Path to work directory") + path := pathFlag.Default(".").ExistingDir() + + kcfgFlag := kingpin.Flag("kernels", "Path to kernels config") + kcfg := kcfgFlag.Envar("OUT_OF_TREE_KCFG").Required().ExistingFile() + + kingpin.Command("pew", "Build, run and test module/exploit") var err error switch kingpin.Parse() { case "pew": - err = pewHandler(*path, *kernelsConfig) + err = pewHandler(*path, *kcfg) } if err != nil {