Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: sub-command completion
- X-seq: zsh-users 24198
- From: Pier Paolo Grassi <pierpaolog@xxxxxxxxx>
- To: Zsh-Users List <zsh-users@xxxxxxx>
- Subject: Re: sub-command completion
- Date: Mon, 2 Sep 2019 17:56:13 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=Kn6HIUz2E1SCc9hEbHwV5AyycGjKqUN4+Es4KkmGyT4=; b=D9VuSfmq0p48Q6GpGr/7BUsv3LYb9oueDdm2P8WH+QwQ1SUhS3cTm97ua9dT2zGbQW 4dL7giSKnXAMqu1lNuWNw/dPTJ3Fzr4Rlx206+Tx99wNkMNoN7k30IwtcW5gARhdlNmI 71E4zMkHuTAPOpHmoo8iimj861Vk01lzOQNpdxcYO5J/Rq9L3jXNnypst72EI3+zfkO+ MT2DWwX4TzglU1BAR7ZhWibzjYE5JFVqEKaEJIsxFVjpkkm+Bq/L3D9OAYJKqhGdo2e+ A5HCtyugIT32jmo2Fb7tCL2T4HEXz7stmigDJ6iGOZI0WSX9ZhDeA4pAvTUZ225a3xem U3lA==
- In-reply-to: <CAP+y1xA9M7g2CkVPTSsb5Nk4sb-VTzhyNYupW50VytSwaTb18w@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <CAP+y1xA9M7g2CkVPTSsb5Nk4sb-VTzhyNYupW50VytSwaTb18w@mail.gmail.com>
Sorry for the previous posting, the mail I wanted to ask again for
suggestions is the one quoted here
any help appreciated, thanks!
Pier Paolo Grassi
linkedin: https://www.linkedin.com/in/pier-paolo-grassi-19300217
founder: https://www.meetup.com/it-IT/Machine-Learning-TO
Il giorno gio 29 ago 2019 alle ore 11:48 Pier Paolo Grassi <
pierpaolog@xxxxxxxxx> ha scritto:
> Hello, I am trying to understand if it is possible to control the behavior
> of _gnu_generic completion.
> I have a command which defines different options if a non-option first
> argument has already been inserted on the command line, eg:
>
> command -x -y sub-command
>
> I have defined a custom completion function like this:
>
> <----- CODE
> # omissis code to populate the vars description_array and commands_array
>
> if [[ ${words[-1]} == -* ]]
> then
> _gnu_generic
> else
> _arguments -s -S -A '-*' \
> "1:commands:->commands" \
> "*:files:_files"
> fi
>
> case $state in
> (commands)
> compadd -V commands -a -l -d description_array -Q -U commands_array
> ;;
> esac
>
> CODE ----->
>
> Now I would like to make _gnu_generic complete with the options offered by:
>
> command subcommand --help
>
> when a subcommand has already been inserted on the command line. But I
> can't figure out how to do so, can anyone help me out?
>
> thanks
>
> Pier Paolo Grassi
> linkedin: https://www.linkedin.com/in/pier-paolo-grassi-19300217
> founder: https://www.meetup.com/it-IT/Machine-Learning-TO
>
Messages sorted by:
Reverse Date,
Date,
Thread,
Author