forked from vieter-v/vieter
feat(cli): add aur search command
parent
1b7cabdd74
commit
487b235727
|
@ -27,3 +27,6 @@ gdb.txt
|
||||||
# Generated docs
|
# Generated docs
|
||||||
_docs/
|
_docs/
|
||||||
/man/
|
/man/
|
||||||
|
|
||||||
|
# VLS logs
|
||||||
|
vls.log
|
||||||
|
|
|
@ -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)?)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,6 +7,7 @@ import console.targets
|
||||||
import console.logs
|
import console.logs
|
||||||
import console.schedule
|
import console.schedule
|
||||||
import console.man
|
import console.man
|
||||||
|
import console.aur
|
||||||
import cron
|
import cron
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -31,6 +32,7 @@ fn main() {
|
||||||
logs.cmd(),
|
logs.cmd(),
|
||||||
schedule.cmd(),
|
schedule.cmd(),
|
||||||
man.cmd(),
|
man.cmd(),
|
||||||
|
aur.cmd(),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
app.setup()
|
app.setup()
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
Module {
|
Module {
|
||||||
dependencies: [
|
dependencies: [
|
||||||
'https://git.rustybever.be/vieter-v/conf',
|
'https://git.rustybever.be/vieter-v/conf',
|
||||||
'https://git.rustybever.be/vieter-v/docker'
|
'https://git.rustybever.be/vieter-v/docker',
|
||||||
|
'https://git.rustybever.be/vieter-v/aur'
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue