mirror of
https://github.com/rancher/os.git
synced 2025-09-01 06:40:31 +00:00
move the new cli to 'os' - its very experimental atm
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
This commit is contained in:
@@ -35,6 +35,31 @@ func Main() {
|
||||
return nil
|
||||
}
|
||||
|
||||
//factory := &service.ProjectFactory{}
|
||||
|
||||
app.Commands = []cli.Command{}
|
||||
app.Commands = append(app.Commands, originalCli...)
|
||||
app.Commands = append(app.Commands, hiddenInternalCommands...)
|
||||
|
||||
app.Run(os.Args)
|
||||
}
|
||||
|
||||
func NewMain() {
|
||||
log.InitLogger()
|
||||
app := cli.NewApp()
|
||||
|
||||
app.Name = os.Args[0]
|
||||
app.Usage = "Control and configure RancherOS"
|
||||
app.Version = config.Version
|
||||
app.Author = "Rancher Labs, Inc."
|
||||
app.EnableBashCompletion = true
|
||||
app.Before = func(c *cli.Context) error {
|
||||
if os.Geteuid() != 0 {
|
||||
log.Fatalf("%s: Need to be root", os.Args[0])
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
factory := &service.ProjectFactory{}
|
||||
|
||||
app.Commands = []cli.Command{
|
||||
@@ -144,14 +169,6 @@ func Main() {
|
||||
HideHelp: true,
|
||||
Action: dummy,
|
||||
},
|
||||
// old..
|
||||
{
|
||||
Name: "old",
|
||||
ShortName: "o",
|
||||
Usage: "old Command line (deprecated, will be removed in future)",
|
||||
HideHelp: true,
|
||||
Subcommands: originalCli,
|
||||
},
|
||||
}
|
||||
app.Commands = append(app.Commands, hiddenInternalCommands...)
|
||||
|
||||
|
Reference in New Issue
Block a user