Skip to content

Add tab completion for stow #9571

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

Merged
merged 4 commits into from
Feb 18, 2023

Conversation

bagohart
Copy link
Contributor

@bagohart bagohart commented Feb 13, 2023

Description

I added tab completions for GNU stow

I tried to keep the descriptions short, but I couldn't come up with shorter descriptions for adopt, defer and override. Maybe someone has a suggestion to shorten those?

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.rst

complete -c stow -s d -l dir -r -d 'Set stow dir, default $STOW_DIR or current dir'
complete -c stow -s t -l target -r -d 'Set target dir, default parent of stow dir'
complete -c stow -l ignore -x -d 'Ignore files ending in this Perl regex'
complete -c stow -l defer -x -d "Don't stow files beginning with this Perl regex if already stowed to another package"
Copy link
Member

Choose a reason for hiding this comment

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

I think you can leave off "to another package" without a real loss in information:

"Don't stow files beginning with this Perl regex if already stowed"

complete -c stow -l defer -x -d "Don't stow files beginning with this Perl regex if already stowed to another package"
complete -c stow -l override -x -d "Force stowing files beginning with this Perl regex if already stowed to another package"
complete -c stow -l no-folding -d "Create dirs instead of symlinks to whole dirs"
complete -c stow -l adopt -d "CAUTION, OVERWRITES FILES IN STOW DIR! Move existing files into stow dir if target exists"
Copy link
Member

Choose a reason for hiding this comment

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

No need to have the warning that long:

"Move existing files into stow dir if target exists (and overwrite!)"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, I implemented the other suggestions without modifications, but for this one I have allcapsed the and overwrite, since the documentation is very insistent that this is exceptional behaviour, since it's the only option that can make stow lose data.

# action flags
complete -c stow -s D -l delete -r -d "Unstow the package names that follow this option"
complete -c stow -s S -l stow -r -d "Stow the package names that follow this option"
complete -c stow -s R -l restow -r -d "Restow: like stow -D followed by stow -S"
Copy link
Member

Choose a reason for hiding this comment

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

I'm never a massive fan of explaining options in terms of other options, that just means people end up chasing the descriptions. How about

"delete and then stow again"

@faho faho merged commit 3dd8db2 into fish-shell:master Feb 18, 2023
@faho
Copy link
Member

faho commented Feb 18, 2023

Thanks, merged!

@faho faho added this to the fish 3.6.1 milestone Feb 18, 2023
zanchey pushed a commit that referenced this pull request Feb 27, 2023
(cherry picked from commit 3dd8db2)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants