mirror of
https://github.com/drone/drone-cli.git
synced 2024-06-08 15:06:04 +02:00
add active flag to filter active repos
This commit is contained in:
parent
f9fd3fe42b
commit
c575af0a88
|
@ -24,6 +24,10 @@ var repoListCmd = cli.Command{
|
|||
Name: "org",
|
||||
Usage: "filter by organization",
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "active",
|
||||
Usage: "filter active repositories only",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -43,11 +47,14 @@ func repoList(c *cli.Context) error {
|
|||
return err
|
||||
}
|
||||
|
||||
org := c.String("org")
|
||||
org, active := c.String("org"), c.Bool("active")
|
||||
for _, repo := range repos {
|
||||
if org != "" && org != repo.Namespace {
|
||||
continue
|
||||
}
|
||||
if !repo.Active && active {
|
||||
continue
|
||||
}
|
||||
tmpl.Execute(os.Stdout, repo)
|
||||
}
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue