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

[improve][cli] Add generate-completion command to admin and client #22557

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nodece
Copy link
Member

@nodece nodece commented Apr 22, 2024

Motivation

The tab-completion is an important feature, we have migrated the CLI parser to picocli from jcommander, right now we can use the picocli autocomplete to do that.

  • pulsar-admin
❯ source <(bin/pulsar-admin generate-completion)
❯ bin/pulsar-admin topics clear-backlog --subscription
--help          --subscription  --version       -h              -s              -v  
  • pulsar-client
❯ source <(bin/pulsar-client generate-completion)
❯ bin/pulsar-client produce -h
--chunking                 --files                    --key-value-key            --rate                     -db                        -h                         -kvkf                      -s                       
--disable-batching         --help                     --key-value-key-file       --separator                -dr                        -k                         -m                         -v                       
--disable-replication      --key                      --messages                 --value-schema             -ekn                       -ks                        -n                         -vs                      
--encryption-key-name      --key-schema               --num-produce              --version                  -ekv                       -kvet                      -p                                                  
--encryption-key-value     --key-value-encoding-type  --properties               -c                         -f                         -kvk                       -r  

Modifications

  • Add generate-completion command to the pulsar-admin and pulsar-client, which supports the bash and zsh

Documentation

  • doc
  • doc-required
  • doc-not-needed
  • doc-complete

Signed-off-by: Zixuan Liu <nodeces@gmail.com>
@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-not-needed Your PR changes do not impact docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant