feat(api): add search query to targets

This commit is contained in:
Jef Roosens 2022-12-31 10:19:59 +01:00 committed by Chewing_Bever
parent 60d5fb77e0
commit f8f611f5c5
Signed by untrusted user: Jef Roosens
GPG key ID: B75D4F293C7052DB
5 changed files with 58 additions and 12 deletions

View file

@ -40,6 +40,12 @@ pub fn cmd() cli.Command {
description: 'Only return targets that publish to this repo.'
flag: cli.FlagType.string
},
cli.Flag{
name: 'query'
abbrev: 'q'
description: 'Search string to filter targets by.'
flag: cli.FlagType.string
},
]
execute: fn (cmd cli.Command) ! {
config_file := cmd.flags.get_string('config-file')!
@ -62,6 +68,11 @@ pub fn cmd() cli.Command {
filter.repo = repo
}
query := cmd.flags.get_string('query')!
if query != '' {
filter.query = query
}
raw := cmd.flags.get_bool('raw')!
list(conf, filter, raw)!