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

Use Cobra to provide all shell completions #199

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .goreleaser.yml
Expand Up @@ -17,7 +17,7 @@ archives:
- README.md
- LICENSE
- plugin.yaml
- completion.yaml
- plugin.complete
- scripts/install_plugin.sh
checksum:
name_template: 'checksums.txt'
3 changes: 2 additions & 1 deletion cmd/move_config.go
Expand Up @@ -36,7 +36,8 @@ func newMoveConfigCmd(out io.Writer) *cobra.Command {
}
return nil
},
RunE: runMove,
ValidArgs: []string{"config"},
RunE: runMove,
}

flags := cmd.Flags()
Expand Down
35 changes: 0 additions & 35 deletions completion.yaml

This file was deleted.

9 changes: 9 additions & 0 deletions plugin.complete
@@ -0,0 +1,9 @@
#!/usr/bin/env sh

# It is important to quote the $@ variable since the last parameter
# could be empty, which indicates that the prefix to complete is empty.
# For example:
# helm 2to3 convert <TAB>
# compared to
# helm 2to3 convert ngi<TAB>
$HELM_PLUGIN_DIR/bin/2to3 __complete "$@"
2 changes: 1 addition & 1 deletion plugin.yaml
@@ -1,5 +1,5 @@
name: "2to3"
version: "0.9.0"
version: "0.9.1"
usage: "migrate and cleanup Helm v2 configuration and releases in-place to Helm v3"
description: "migrate and cleanup Helm v2 configuration and releases in-place to Helm v3"
command: "$HELM_PLUGIN_DIR/bin/2to3"
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_plugin.sh
Expand Up @@ -41,7 +41,7 @@ fi
tar xzf "releases/v${version}.tar.gz" -C "releases/v${version}"
mv "releases/v${version}/2to3" "bin/2to3" || \
mv "releases/v${version}/2to3.exe" "bin/2to3"
mv "releases/v${version}/completion.yaml" .
mv "releases/v${version}/plugin.complete" .
mv "releases/v${version}/plugin.yaml" .
mv "releases/v${version}/README.md" .
mv "releases/v${version}/LICENSE" .