Skip to content

Commit

Permalink
Fixes 60 - off and cycle
Browse files Browse the repository at this point in the history
`power off` and `power cycle` had `Args: cobra.MinimumNArgs(1)` set. This was previously removed for several other commands because it broke piping.

When piping occurs, at least with how `gru` accepts piped arguments, the `args[]` slice is empty. In order for piping to work, we can not set a minimum number of arguments.

There may be another way to handle piping, assuming there's a way to get in front of Cobra.
  • Loading branch information
rustydb committed Jun 8, 2024
1 parent eb0b5f6 commit 4e56ee2
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 2 deletions.
1 change: 0 additions & 1 deletion pkg/cmd/cli/chassis/power/cycle.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func NewPowerCycleCommand() *cobra.Command {
Short: "Power cycle the target machine(s)",
Long: `Performs an ACPI shutdown and startup to power cycle the target machine(s).
Also allows bypassing the OS shutdown, forcing a warm boot.`,
Args: cobra.MinimumNArgs(1),
Run: func(c *cobra.Command, args []string) {
var resetType redfish.ResetType

Expand Down
1 change: 0 additions & 1 deletion pkg/cmd/cli/chassis/power/off.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func NewPowerOffCommand() *cobra.Command {
Long: `Powers off the target machine(s) with an ACPI shutdown.
Permits forcing a shutdown (without waiting for the OS),
as well as a power-button emulated shutdown.`,
Args: cobra.MinimumNArgs(1),
Run: func(c *cobra.Command, args []string) {
var resetType redfish.ResetType

Expand Down

0 comments on commit 4e56ee2

Please sign in to comment.