Skip to content
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

Generate tab-autocompletion scripts for zsh, bash, fish, & powershell shells #864

Merged
merged 3 commits into from
Mar 3, 2022

Conversation

JoshuaBatty
Copy link
Member

@JoshuaBatty JoshuaBatty commented Mar 3, 2022

forc now supports generating completion scripts for Bash, Fish, Zsh, and PowerShell. See forc completions --help for full details, but the gist is as simple as using one of the following and then restarting your shell for the changes to take effect:

# Bash
$ forc completions --shell=bash > ~/.local/share/bash-completion/completions/forc

# Bash (macOS/Homebrew)
$ forc completions --shell=bash > $(brew --prefix)/etc/bash_completion.d/forc.bash-completion

# Fish
$ mkdir -p ~/.config/fish/completions
$ forc completions --shell=fish > ~/.config/fish/completions/forc.fish

# Zsh
$ forc completions --shell=zsh > ~/.zfunc/_forc

# PowerShell v5.0+
$ forc completions --shell=powershell >> $PROFILE.CurrentUserCurrentHost
# or
$ forc completions --shell=powershell | Out-String | Invoke-Expression

addresses the autocompletion step in #482

@JoshuaBatty JoshuaBatty self-assigned this Mar 3, 2022
@JoshuaBatty JoshuaBatty added enhancement New feature or request forc labels Mar 3, 2022
Copy link
Contributor

@mitchmindtree mitchmindtree left a comment

Choose a reason for hiding this comment

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

Nice, looks good! I think those docs will be super handy on helping users work out how to actually use them too :)

Copy link
Contributor

@adlerjohn adlerjohn left a comment

Choose a reason for hiding this comment

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

Works

@JoshuaBatty JoshuaBatty merged commit b2eb211 into master Mar 3, 2022
@JoshuaBatty JoshuaBatty deleted the josh/shell_autocomplete branch March 3, 2022 01:29
@JoshuaBatty
Copy link
Member Author

JoshuaBatty commented Mar 3, 2022

forc_auto_complete

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request forc
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants