mesheryctl: New `completion` command to generate autocompletions script for the specified shell (bash or zsh)

Created on 28 Jan 2020  路  7Comments  路  Source: layer5io/meshery

Current Behavior
CLI users enjoy and benefit from less typing when they have enabled autocompletion for a command line interface. mesheryctl does not currently provide a completion command from which the full set of mesheryctl commands may be sourced for the user's specific type of shell (bash or zsh).

Desired Behavior
Leveraging Cobra's generator, create a new completion command is created with the following parameters and flags:

    1.
mesheryctl completion SHELL - Generates autocompletion script for the specified shell (bash or zsh)
    2.
meshery completion --help

Generate autocompletion script for Meshery for the specified shell (bash or zsh).

This command can generate shell autocompletions. e.g.

    $ mesheryctl completion bash

Can be sourced as such

    $ source <(mesheryctl completion bash)

Usage:
  mesheryctl completion SHELL [flags]

Flags:
  -h, --help   help for completion
  1. Provide detailed instructions to users by updating the Meshery docs. Use kubectl's docs as an example - https://kubernetes.io/docs/tasks/tools/install-kubectl/#enabling-shell-autocompletion
componenmesheryctl help wanted issuwillfix kinenhancement languaggo

All 7 comments

@leecalcote I could take up this one if that's okay

This one has your name all over it, @mayankshah1607. ;)

This is the enhancement you were talking about @nitishm, right?

Yessir

Hi @WLun001, we would love to have your help here. Given your experience with autocomplete (and fish shell) will you consider taking on this issue?

@leecalcote I can try out probably sometimes in this week or next week

@WLun001, that would be fantastic. 馃槃

Was this page helpful?
0 / 5 - 0 ratings