feat(api): add search query to targets
This commit is contained in:
parent
60d5fb77e0
commit
f8f611f5c5
5 changed files with 58 additions and 12 deletions
|
|
@ -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)!
|
||||
|
|
|
|||
Reference in a new issue