forked from vieter-v/vieter
feat: add api & cli command to remove log
This commit is contained in:
parent
8b72a9fc0f
commit
af409011e6
3 changed files with 44 additions and 0 deletions
|
|
@ -138,6 +138,18 @@ pub fn cmd() cli.Command {
|
|||
list(conf, filter, raw)!
|
||||
}
|
||||
},
|
||||
cli.Command{
|
||||
name: 'remove'
|
||||
required_args: 1
|
||||
usage: 'id'
|
||||
description: 'Remove a build log that matches the given id.'
|
||||
execute: fn (cmd cli.Command) ! {
|
||||
config_file := cmd.flags.get_string('config-file')!
|
||||
conf := vconf.load<Config>(prefix: 'VIETER_', default_path: config_file)!
|
||||
|
||||
remove(conf, cmd.args[0])!
|
||||
}
|
||||
},
|
||||
cli.Command{
|
||||
name: 'info'
|
||||
required_args: 1
|
||||
|
|
@ -204,3 +216,9 @@ fn content(conf Config, id int) ! {
|
|||
|
||||
println(content)
|
||||
}
|
||||
|
||||
// remove removes a build log from the server's list.
|
||||
fn remove(conf Config, id string) ! {
|
||||
c := client.new(conf.address, conf.api_key)
|
||||
c.remove_build_log(id.int())!
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue