forked from vieter-v/vieter
				
			feat(cli): add aur search command
							parent
							
								
									1b7cabdd74
								
							
						
					
					
						commit
						487b235727
					
				| 
						 | 
				
			
			@ -27,3 +27,6 @@ gdb.txt
 | 
			
		|||
# Generated docs
 | 
			
		||||
_docs/
 | 
			
		||||
/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.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()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue