zsh-workers
 help / color / mirror / code / Atom feed
From: Christian K <syphdias@gmail.com>
To: zsh-workers@zsh.org
Cc: myllynen@redhat.com
Subject: OpenStack CLI completion
Date: Sun, 7 Mar 2021 19:11:03 +0100	[thread overview]
Message-ID: <CAJiY44of8c0y1pS_eVjF6-KnCc1pZFSiiwJSs8PPybpyPx1+cw@mail.gmail.com> (raw)

Hi,

I stumbled upon a bug in the completion for openstack command
introduced in https://www.zsh.org/mla/workers/2016/msg01936.html

I noticed that the suggestions stop for further subcommands at a certain point.
An example:
`openstack vpn <tab>` offers "endpoint", "ike", "ipsec" and "service"
– perfect, selecting "ipsec"!
`openstack vpn ipsec <tab>` offers nothing – It should offer "policy",
"site" as can be seen here:

# I removed flag suggestions -* for readability reasons
❯ echo $_cache_openstack_clnt_outputs |grep cmds_vpn_ipsec |sed
"s/='-.*/='...'/"
  cmds_vpn_ipsec='policy site'
  cmds_vpn_ipsec_policy='create delete list set show'
  cmds_vpn_ipsec_policy_create='...'
  cmds_vpn_ipsec_policy_delete='...'
  cmds_vpn_ipsec_policy_list='...'
  cmds_vpn_ipsec_policy_set='...'
  cmds_vpn_ipsec_policy_show='...'
  cmds_vpn_ipsec_site='connection'
  cmds_vpn_ipsec_site_connection='create delete list set show'
  cmds_vpn_ipsec_site_connection_create='...'
  cmds_vpn_ipsec_site_connection_delete='...'
  cmds_vpn_ipsec_site_connection_list='...'
  cmds_vpn_ipsec_site_connection_set='...'
  cmds_vpn_ipsec_site_connection_show='...'

This issue continues after selecting "site"
`openstack vpn ipsec site <tab>` , no offers – should be "connection"
(only one, see above)
`openstack vpn ipsec site connection <tab>` no offers – should be
"create", "delete", "list", "set" and "show"

In the thread it was introduced in, there were some discussions
whether it should be included in zsh or in the openstack project. Is
there interest in a patch to fix this?

I have some idea how to fix this by making some assumptions but I am
not certain it's the right way. I would probably get rid of $subcmd
and just take the longest string of words connected by underscores as
$cmd to find the right suggestions.
Some barriers I currently have:
* There is also some substitution going on for colon which I just don't get
* Why is there a check for not prefix-needed?

Some comments from the original author would be quite helpful if he
still remembers why it was done a certain way :)

Best,
Christian


             reply	other threads:[~2021-03-07 18:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-07 18:11 Christian K [this message]
2021-03-08 15:58 ` Marko Myllynen
2021-03-18 22:45   ` Christian K
2021-03-19  9:37     ` Marko Myllynen
2021-03-19 22:05       ` Christian K
2021-03-27 16:31         ` Lawrence Velázquez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAJiY44of8c0y1pS_eVjF6-KnCc1pZFSiiwJSs8PPybpyPx1+cw@mail.gmail.com \
    --to=syphdias@gmail.com \
    --cc=myllynen@redhat.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).