zsh-workers
 help / color / mirror / code / Atom feed
* OpenStack CLI completion
@ 2021-03-07 18:11 Christian K
  2021-03-08 15:58 ` Marko Myllynen
  0 siblings, 1 reply; 6+ messages in thread
From: Christian K @ 2021-03-07 18:11 UTC (permalink / raw)
  To: zsh-workers; +Cc: myllynen

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-03-27 16:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-07 18:11 OpenStack CLI completion Christian K
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

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).