diff --git a/.gitignore b/.gitignore index 4d9f94f2..a2804fe6 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,6 @@ gdb.txt # Generated docs _docs/ /man/ + +# VLS logs +vls.log diff --git a/src/console/aur/aur.v b/src/console/aur/aur.v new file mode 100644 index 00000000..3f20dfca --- /dev/null +++ b/src/console/aur/aur.v @@ -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)?) + } + }, + ] + } +} diff --git a/src/main.v b/src/main.v index cba410ce..4ade9305 100644 --- a/src/main.v +++ b/src/main.v @@ -7,6 +7,7 @@ import console.targets import console.logs import console.schedule import console.man +import console.aur import cron fn main() { @@ -31,6 +32,7 @@ fn main() { logs.cmd(), schedule.cmd(), man.cmd(), + aur.cmd(), ] } app.setup() diff --git a/src/v.mod b/src/v.mod index 5b890629..710c976c 100644 --- a/src/v.mod +++ b/src/v.mod @@ -1,6 +1,7 @@ Module { dependencies: [ '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' ] }