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

Add support for powershell completions #1094

Merged
merged 2 commits into from
Mar 5, 2021
Merged

Conversation

sambhav
Copy link
Member

@sambhav sambhav commented Feb 27, 2021

Summary

Adds support for powershell completions

Output

Before

$ pack completion --shell powershell
ERROR: powershell is unsupported shell
$ pack completion --help
Generates completion script and outputs its location.

To configure your bash shell to load completions for each session, add the following to your '.bashrc' or '.bash_profile':

	. $(pack completion)

To configure your fish shell to load completions for each session, add the following to your '~/.config/fish/config.fish':

	source (pack completion --shell fish)

To configure your zsh shell to load completions for each session, add the following to your '.zshrc':

	. $(pack completion --shell zsh)

Usage:
  pack completion [flags]

Flags:
  -h, --help           help for completion
  -s, --shell string   Generates completion file for [bash|fish|zsh] (default "bash")

Global Flags:
      --no-color     Disable color output
  -q, --quiet        Show less output
      --timestamps   Enable timestamps in output
  -v, --verbose      Show more output

After

$ pack completion --shell powershell
/home/sam/.pack/completion.ps1
$ pack completion --help
Generates completion script and outputs its location.

To configure your bash shell to load completions for each session, add the following to your '.bashrc' or '.bash_profile':

	. $(pack completion)

To configure your fish shell to load completions for each session, add the following to your '~/.config/fish/config.fish':

	source (pack completion --shell fish)

To configure your powershell to load completions for each session, add the following to your '$PSHOME\Profile.ps1':

	. $(pack completion --shell powershell)

To configure your zsh shell to load completions for each session, add the following to your '.zshrc':

	. $(pack completion --shell zsh)

Usage:
  pack completion [flags]

Flags:
  -h, --help           help for completion
  -s, --shell string   Generates completion file for [bash|fish|powershell|zsh] (default "bash")

Global Flags:
      --no-color     Disable color output
  -q, --quiet        Show less output
      --timestamps   Enable timestamps in output
  -v, --verbose      Show more output

Documentation

  • Should this change be documented?
    • Yes, see #___
    • No

Related

Resolves #976

@sambhav sambhav requested a review from a team as a code owner February 27, 2021 08:46
@github-actions github-actions bot added this to the 0.18.0 milestone Feb 27, 2021
@github-actions github-actions bot added the type/enhancement Issue that requests a new feature or improvement. label Feb 27, 2021
@codecov
Copy link

codecov bot commented Feb 27, 2021

Codecov Report

Merging #1094 (14c8aff) into main (89e9f4a) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1094      +/-   ##
==========================================
+ Coverage   80.36%   80.38%   +0.03%     
==========================================
  Files         133      133              
  Lines        8160     8170      +10     
==========================================
+ Hits         6557     6567      +10     
  Misses       1174     1174              
  Partials      429      429              
Flag Coverage Δ
os_linux 79.78% <100.00%> (+0.06%) ⬆️
os_macos ?
os_windows 80.30% <100.00%> (+0.03%) ⬆️
unit 79.78% <100.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Copy link
Contributor

@dwillist dwillist left a comment

Choose a reason for hiding this comment

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

Hey @samj1912 thanks! This looks & works perfectly. One small nitpick but we can make this small change before merging.

internal/commands/completion.go Outdated Show resolved Hide resolved
@dfreilich dfreilich merged commit 06ed50d into buildpacks:main Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement Issue that requests a new feature or improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Powershell Completion
3 participants