2021-05-24 00:11:57 +03:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
|
|
|
goflags "github.com/jessevdk/go-flags"
|
2021-05-24 00:11:58 +03:00
|
|
|
"github.com/motiejus/code/undocker/internal/cmdlxcconfig"
|
2021-05-24 00:11:58 +03:00
|
|
|
"github.com/motiejus/code/undocker/internal/cmdmanpage"
|
2021-05-24 00:11:58 +03:00
|
|
|
"github.com/motiejus/code/undocker/internal/cmdrootfs"
|
2021-05-24 00:11:57 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2021-05-24 00:11:58 +03:00
|
|
|
parser := goflags.NewParser(nil, goflags.Default)
|
2021-05-24 00:11:58 +03:00
|
|
|
|
|
|
|
rootfs := cmdrootfs.NewCommand()
|
|
|
|
lxcconfig := cmdlxcconfig.NewCommand()
|
2021-05-24 00:11:58 +03:00
|
|
|
manpage := cmdmanpage.NewCommand(parser)
|
|
|
|
parser.AddCommand("rootfs", rootfs.ShortDesc(), rootfs.LongDesc(), rootfs)
|
|
|
|
parser.AddCommand("lxcconfig", lxcconfig.ShortDesc(), lxcconfig.LongDesc(), lxcconfig)
|
|
|
|
m, _ := parser.AddCommand("man-page", "", "", manpage)
|
|
|
|
m.Hidden = true
|
2021-05-24 00:11:58 +03:00
|
|
|
|
2021-05-24 00:11:58 +03:00
|
|
|
_, err := parser.Parse()
|
2021-05-24 00:11:58 +03:00
|
|
|
if err != nil {
|
2021-05-24 00:11:57 +03:00
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
os.Exit(0)
|
|
|
|
}
|