cli: targets add now supports raw flag
ci/woodpecker/pr/lint Pipeline was successful Details
ci/woodpecker/pr/docs Pipeline was successful Details
ci/woodpecker/pr/build Pipeline was successful Details
ci/woodpecker/pr/docker Pipeline was successful Details
ci/woodpecker/pr/man Pipeline was successful Details
ci/woodpecker/pr/test Pipeline was successful Details

pull/271/head
Jef Roosens 2022-10-01 16:02:43 +02:00
parent 8a08788935
commit fab8ca20b8
Signed by: Jef Roosens
GPG Key ID: B75D4F293C7052DB
1 changed files with 9 additions and 3 deletions

View File

@ -94,7 +94,9 @@ pub fn cmd() cli.Command {
branch: cmd.flags.get_string('branch') or { '' }
}
add(conf, t)?
raw := cmd.flags.get_bool('raw')?
add(conf, t, raw)?
}
},
cli.Command{
@ -208,11 +210,15 @@ fn list(conf Config, filter TargetFilter, raw bool) ? {
}
// add adds a new repository to the server's list.
fn add(conf Config, t &NewTarget) ? {
fn add(conf Config, t &NewTarget, raw bool) ? {
c := client.new(conf.address, conf.api_key)
res := c.add_target(t)?
if raw {
println(res.data)
} else {
println('Target added with id $res.data')
}
}
// remove removes a repository from the server's list.