1
0

Add command for list kernels

This commit is contained in:
dump_stack() 2018-11-17 13:20:29 +00:00
parent c781511e72
commit f9963e51a8

10
main.go
View File

@ -481,6 +481,11 @@ func pewHandler(kcfg kernelConfig, workPath, ovrrdKrnl, binary, test string,
return return
} }
func kernelListHandler(kcfg kernelConfig) (err error) {
for _, kernel := range kcfg.Kernels {
fmt.Println(kernel.DistroType, kernel.DistroRelease,
kernel.KernelRelease)
}
return return
} }
@ -518,6 +523,9 @@ func main() {
pewTestFlag := pewCommand.Flag("test", "Override path test") pewTestFlag := pewCommand.Flag("test", "Override path test")
pewTest := pewTestFlag.String() pewTest := pewTestFlag.String()
kernelCommand := app.Command("kernel", "Manipulate kernels")
kernelListCommand := kernelCommand.Command("list", "List kernels")
kcfg, err := readKernelConfig(*kcfgPath) kcfg, err := readKernelConfig(*kcfgPath)
if err != nil { if err != nil {
return return
@ -527,6 +535,8 @@ func main() {
case pewCommand.FullCommand(): case pewCommand.FullCommand():
err = pewHandler(kcfg, *path, *pewKernel, *pewBinary, err = pewHandler(kcfg, *path, *pewKernel, *pewBinary,
*pewTest, *pewGuess, *qemuTimeout, *dockerTimeout) *pewTest, *pewGuess, *qemuTimeout, *dockerTimeout)
case kernelListCommand.FullCommand():
err = kernelListHandler(kcfg)
} }
if err != nil { if err != nil {