Skip to content

Added more Bash-complete instances in multipass stop --force #4072

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Artem-OSSRevival
Copy link

Closes: #3682
Previously, when the TAB pressed, only ‘Running’ instances were completed.
Now, if the --force flag is provided, additionally taken into account 'Starting', 'Restarting', 'Suspending' and 'Suspended' ones.

To reproduce:
Run service:
sudo /usr/local/bin/multipassd

Run GUI:
/usr/local/bin/multipass.gui

start and then suspend the instance

OR start/stop/suspend tasks can be done from the CLI:
multipass start --all
multipass suspend --all

Before:
Open Bash and add the script:
source <multipass>/completions/bash/multipass

Check the instance is suspended:
multipass ls

Try the bash-completion ('n' is the first letter of the instance’s name):
multipass stop --force n[TAB]

Nothing happens.

After:
Reopen Bash and add the script:
source <multipass>/completions/bash/multipass
multipass ls
multipass stop --force n[TAB]

natty-nilgai (real instance name) will be completed.

…l#3682

Previously, when the <TAB> pressed, only Running instances were added. Now, if the --force flag is provided, additionally taken into account 'Starting', 'Restarting', 'Suspended' and 'Suspending' instances

Signed-off-by: Artem-OSSRevival <[email protected]>
@ricab ricab requested a review from Copilot May 6, 2025 14:18
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.

Files not reviewed (1)
  • completions/bash/multipass: Language not supported

Copy link
Member

@xmkg xmkg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the contribution! A small improvement would be accepting an array of states to _multipass_instances to avoid repetition, but I'm okay with the current state as well.

@ricab ricab added this to the 1.16.0 milestone May 26, 2025
@ricab ricab requested a review from levkropp May 29, 2025 15:26
Copy link
Contributor

@levkropp levkropp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep LGTM! I suspended an instance with multipass suspend revered-goblin and saw it as one of the autocomplete options

$ multipass stop --force 
--all           --cancel        --help          revered-goblin  --time          --verbose

That being said, I don't see --force as a complete option for multipass stop

$ multipass stop --
--all      --cancel   --help     --time     --verbose  

but that's outside the scope of this PR. Approved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bash-complete more instances inmultipass stop --force
4 participants