Skip to content

zsh completion fails #2933

@cwrau

Description

@cwrau

What happened:
I tried for the commands which fails

What you expected to happen:
No failing but instead have completion provided

How to reproduce it (as minimally and precisely as possible):

  • /usr/bin/grype completion zsh > /usr/share/zsh/site-functions/_grype
  • reload zsh exec zsh
  • grype <tab>
  • see nothing happens

Anything else we need to know?:
Output of the debugging log;

========= starting completion logic ==========
CURRENT: 2, words[*]: grype 
Truncated words[*]: grype ,
lastParam: , lastChar: 
Adding extra empty parameter
About to call: eval grype __complete  ""
completion output: completion	Generate a shell completion for Grype (listing local docker images)
config	show the grype configuration
db	vulnerability database operations
explain	Ask grype to explain a set of findings
help	Help about any command
version	show version information
completion failed
:1
last line: :1
directive: 1
completions: completion	Generate a shell completion for Grype (listing local docker images)
config	show the grype configuration
db	vulnerability database operations
explain	Ask grype to explain a set of findings
help	Help about any command
version	show version information
completion failed
flagPrefix: 
Completion received error. Ignoring completions.

having already completed typing something whole completion works a little bit;

========= starting completion logic ==========
CURRENT: 3, words[*]: grype db 
Truncated words[*]: grype db ,
lastParam: , lastChar: 
Adding extra empty parameter
About to call: eval grype __complete db  ""
completion output: check	Check to see if there is a database update available
delete	Delete the vulnerability database
import	Import a vulnerability database or archive from a local file or URL
list	List all DBs available according to the listing URL
providers	List vulnerability providers that are in the database
search	Search the DB for vulnerabilities or affected packages
status	Display database status and metadata
update	Download and install the latest vulnerability database
:4
last line: :4
directive: 4
completions: check	Check to see if there is a database update available
delete	Delete the vulnerability database
import	Import a vulnerability database or archive from a local file or URL
list	List all DBs available according to the listing URL
providers	List vulnerability providers that are in the database
search	Search the DB for vulnerabilities or affected packages
status	Display database status and metadata
update	Download and install the latest vulnerability database
flagPrefix: 
Adding completion: check:Check to see if there is a database update available
Adding completion: delete:Delete the vulnerability database
Adding completion: import:Import a vulnerability database or archive from a local file or URL
Adding completion: list:List all DBs available according to the listing URL
Adding completion: providers:List vulnerability providers that are in the database
Adding completion: search:Search the DB for vulnerabilities or affected packages
Adding completion: status:Display database status and metadata
Adding completion: update:Download and install the latest vulnerability database
Calling _describe
_describe found some completions

Environment:

  • Output of grype version: 0.99.1
  • OS (e.g: cat /etc/os-release or similar): Arch Linux

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions