mirror of
https://github.com/rancher/os.git
synced 2025-08-31 22:32:14 +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...)
|
||||
|
||||
|
1
cmd/control/entrypoint.go
Normal file → Executable file
1
cmd/control/entrypoint.go
Normal file → Executable file
@@ -103,6 +103,7 @@ func setupCommandSymlinks() {
|
||||
{config.RosBin, "/sbin/reboot"},
|
||||
{config.RosBin, "/sbin/halt"},
|
||||
{config.RosBin, "/sbin/shutdown"},
|
||||
{config.RosBin, "/sbin/os"},
|
||||
} {
|
||||
if err := os.Symlink(link.oldname, link.newname); err != nil {
|
||||
log.Error(err)
|
||||
|
Reference in New Issue
Block a user