Skip to content
This repository has been archived by the owner on Dec 7, 2023. It is now read-only.

List all VMs if ignite ps is called via any of its aliases #179

Merged
merged 1 commit into from
Jul 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cmd/ignite/cmd/vmcmd/ps.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ func NewCmdPs(out io.Writer) *cobra.Command {
also list VMs that are not currently running.
`),
Run: func(cmd *cobra.Command, args []string) {
// If `ps` is called via any of its aliases
// (`ls`, `list`), list all VMs
if cmd.CalledAs() != cmd.Name() {
pf.All = true
}

errutils.Check(func() error {
po, err := pf.NewPsOptions()
if err != nil {
Expand Down