Skip to content

Commit

Permalink
cleanup: flags
Browse files Browse the repository at this point in the history
  • Loading branch information
chetan committed Nov 5, 2021
1 parent 3f45744 commit f64651c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 3 additions & 1 deletion bin/vproxy/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ vproxy connect hello.local:8888 -- vproxy hello
{
Name: "caroot",
Usage: "Print CAROOT path and exit",
Hidden: hideFlags,
Action: printCAROOT,
Before: loadClientConfig,
Flags: []cli.Flag{
Expand Down Expand Up @@ -244,6 +245,7 @@ vproxy connect hello.local:8888 -- vproxy hello
{
Name: "bash_completion",
Usage: "Generate bash completion script",
Hidden: hideFlags,
Action: genBashCompletion,
Description: `To use bash completion, add the following to your .bashrc:
Expand Down Expand Up @@ -277,7 +279,7 @@ or add a file to your bash_completion.d:
// Hide flags unless verbose flag set
func shouldHideFlags() bool {
for _, f := range os.Args {
if f == "--verbose" || f == "-v" {
if f == "--verbose" || f == "-v" || f == "--generate-bash-completion" {
return false
}
}
Expand Down
3 changes: 1 addition & 2 deletions bin/vproxy/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,7 @@ func printInfo(c *cli.Context) error {
}

func genBashCompletion(c *cli.Context) error {
comp := `
#! /bin/bash
comp := `#! /bin/bash
_cli_bash_autocomplete() {
if [[ "${COMP_WORDS[0]}" != "source" ]]; then
Expand Down

0 comments on commit f64651c

Please sign in to comment.