1
0

Move kernel command to another file

This commit is contained in:
dump_stack() 2018-11-17 20:24:09 +00:00
parent ce7fce49f5
commit cc3f536c62
2 changed files with 22 additions and 10 deletions

22
kernel.go Normal file
View File

@ -0,0 +1,22 @@
// Copyright 2018 Mikhail Klementev. All rights reserved.
// Use of this source code is governed by a AGPLv3 license
// (or later) that can be found in the LICENSE file.
package main
import (
"errors"
"fmt"
"github.com/jollheef/out-of-tree/config"
)
func kernelListHandler(kcfg config.KernelConfig) (err error) {
if len(kcfg.Kernels) == 0 {
return errors.New("No kernels found")
}
for _, k := range kcfg.Kernels {
fmt.Println(k.DistroType, k.DistroRelease, k.KernelRelease)
}
return
}

10
main.go
View File

@ -5,7 +5,6 @@
package main
import (
"fmt"
"log"
"os"
"os/user"
@ -15,14 +14,6 @@ import (
"github.com/jollheef/out-of-tree/config"
)
func kernelListHandler(kcfg config.KernelConfig) (err error) {
for _, kernel := range kcfg.Kernels {
fmt.Println(kernel.DistroType, kernel.DistroRelease,
kernel.KernelRelease)
}
return
}
func main() {
app := kingpin.New(
"out-of-tree",
@ -50,7 +41,6 @@ func main() {
dockerTimeoutFlag := app.Flag("docker-timeout", "Timeout for docker")
dockerTimeout := dockerTimeoutFlag.Default("1m").Duration()
pewCommand := app.Command("pew", "Build, run and test module/exploit")
pewKernelFlag := pewCommand.Flag("kernel", "Override kernel regex")
pewKernel := pewKernelFlag.String()