feat(cli): add aur search command

This commit is contained in:
Jef Roosens 2022-06-22 16:19:07 +02:00 committed by Chewing_Bever
parent 1b7cabdd74
commit 487b235727
Signed by untrusted user: Jef Roosens
GPG key ID: B75D4F293C7052DB
4 changed files with 33 additions and 1 deletions

26
src/console/aur/aur.v Normal file
View file

@ -0,0 +1,26 @@
module aur
import cli
import console
import vieter_v.aur
pub fn cmd() cli.Command {
return cli.Command{
name: 'aur'
description: 'Interact with the AUR.'
commands: [
cli.Command{
name: 'search'
description: 'Search for packages.'
required_args: 1
execute: fn (cmd cli.Command) ? {
c := aur.new()
pkgs := c.search(cmd.args[0])?
data := pkgs.map([it.name, it.description])
println(console.pretty_table(['name', 'description'], data)?)
}
},
]
}
}