mirror of
https://github.com/rancher/os.git
synced 2025-09-17 15:40:47 +00:00
Fix shutdown -h command (#2234)
This commit is contained in:
@@ -84,7 +84,7 @@ func Shutdown() {
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
app.Flags = append(app.Flags, cli.BoolFlag{
|
app.Flags = append(app.Flags, cli.BoolFlag{
|
||||||
Name: "H, h, halt",
|
Name: "H, halt",
|
||||||
Usage: "halt the machine",
|
Usage: "halt the machine",
|
||||||
Destination: &haltFlag,
|
Destination: &haltFlag,
|
||||||
})
|
})
|
||||||
@@ -94,13 +94,22 @@ func Shutdown() {
|
|||||||
if app.Name == "poweroff" {
|
if app.Name == "poweroff" {
|
||||||
app.Flags = append(app.Flags, cli.BoolTFlag{
|
app.Flags = append(app.Flags, cli.BoolTFlag{
|
||||||
Name: "P, poweroff",
|
Name: "P, poweroff",
|
||||||
Usage: "halt the machine",
|
Usage: "poweroff the machine",
|
||||||
Destination: &poweroffFlag,
|
Destination: &poweroffFlag,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
// shutdown -h
|
||||||
|
// Equivalent to --poweroff
|
||||||
|
if app.Name == "shutdown" {
|
||||||
|
app.Flags = append(app.Flags, cli.BoolFlag{
|
||||||
|
Name: "h",
|
||||||
|
Usage: "poweroff the machine",
|
||||||
|
Destination: &poweroffFlag,
|
||||||
|
})
|
||||||
|
}
|
||||||
app.Flags = append(app.Flags, cli.BoolFlag{
|
app.Flags = append(app.Flags, cli.BoolFlag{
|
||||||
Name: "P, poweroff",
|
Name: "P, poweroff",
|
||||||
Usage: "halt the machine",
|
Usage: "poweroff the machine",
|
||||||
Destination: &poweroffFlag,
|
Destination: &poweroffFlag,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user