Add possiblity to limit actions to tagged or named repository
This commit is contained in:
parent
5c98ab6554
commit
23e4547e52
11 changed files with 345 additions and 24 deletions
|
|
@ -40,6 +40,14 @@ func ParseCliArguments(name, description string, arguments []string) (CliArgumen
|
|||
Help: "Turn off color printing",
|
||||
})
|
||||
|
||||
limitName := parser.String("n", "name", &argparse.Options{
|
||||
Help: "Limit action to the specified repository name",
|
||||
})
|
||||
|
||||
limitTags := parser.StringList("t", "tag", &argparse.Options{
|
||||
Help: "Limit actions to repositories that contain specific tags",
|
||||
})
|
||||
|
||||
if err := parser.Parse(arguments); err != nil {
|
||||
return CliArguments{}, errors.New(parser.Usage("Please follow this help"))
|
||||
}
|
||||
|
|
@ -48,11 +56,17 @@ func ParseCliArguments(name, description string, arguments []string) (CliArgumen
|
|||
return CliArguments{}, errors.New(errNoCommand)
|
||||
}
|
||||
|
||||
if *limitName != "" && len(*limitTags) != 0 {
|
||||
return CliArguments{}, errors.New(errNameAndTagsTogether)
|
||||
}
|
||||
|
||||
return CliArguments{
|
||||
ConfigurationFile: *configFile,
|
||||
Sync: syncCMD.Happened(),
|
||||
Status: statusCMD.Happened(),
|
||||
Version: *version,
|
||||
Color: !(*color),
|
||||
LimitName: *limitName,
|
||||
LimitTags: *limitTags,
|
||||
}, nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue