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

shell completion issue #96

Closed
chenrui333 opened this issue Apr 29, 2024 · 6 comments
Closed

shell completion issue #96

chenrui333 opened this issue Apr 29, 2024 · 6 comments

Comments

@chenrui333
Copy link
Contributor

While packaging for homebrew, I ran into some shell completion issue as below:

~ basti completion zsh
basti <command>

Commands:
  basti init                  Initialize a target to use with Basti                                                                                [aliases: i]
  basti connect [connection]  Start port forwarding session with the selected target                                                               [aliases: c]
  basti cleanup               Remove all resources created by Basti                                                                               [aliases: cl]
  basti completion            Generate completion script for your shell

Options:
  -h, --help     Show help                                                                                                                            [boolean]
  -v, --version  Show version number                                                                                                                  [boolean]

Examples:
  basti init     Initialize a target in interactive mode
  basti connect  Start connection in interactive mode
  basti cleanup  Cleanup Basti resources in interactive mode (requires confirmation)

Did you mean cl?
➜  ~ echo $?
1

Log an issue in here for visibility.

@BohdanPetryshyn
Copy link
Collaborator

Hey @chenrui333, thank you for your work on the homebrew formula! ❤️

Basti uses the yargs library which doesn't expect any additional arguments for the completion command. So the following commands will return exactly the same output:

  1. basti completion zsh
  2. basti completion anything
  3. basti completion

Can the supported basti completion command be used in brew instead of removing the recommendations?

@chenrui333
Copy link
Contributor Author

Can the supported basti completion command be used in brew instead of removing the recommendations?

it simply does not work, based on what I see, there is not much use of recommendCommands

@BohdanPetryshyn
Copy link
Collaborator

Just to clarify, do you mean that basti completion doesn't work or basti completion zsh doesn't work?

The value of the recommendCommands functionality is questionable indeed so if removing it will help in the Homebrew formula creation, we can do this.

@chenrui333
Copy link
Contributor Author

Just to clarify, do you mean that basti completion doesn't work or basti completion zsh doesn't work?

if you do SHELL=zsh basti completion zsh, that does not work.

And SHELL=zsh basti completion bash still outputs bash completion, which is wrong

The value of the recommendCommands functionality is questionable indeed so if removing it will help in the Homebrew formula creation, we can do this.

yeah, let's remove that, I dont see any values of it. People can either do help or just tldr to see the manual

@BohdanPetryshyn
Copy link
Collaborator

According to the yargs docs, the completion command doesn't expect any additional arguments. I can see that the output of the basti completion command changes according to the SHELL env variable:

  1. SHELL=zsh basti completion - outputs completion for zsh
  2. SHELL=bash basti completion - outputs completion for bash

Please, note the absence of any arguments after the completion command. Can the command be used without additional arguments like zsh or bash in Homebrew?

@chenrui333
Copy link
Contributor Author

adopted like that SHELL=zsh basti completion, and it fixed my issue. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants