Support for switching to smira/commander with free placement of flags. #17

This commit is contained in:
Andrey Smirnov
2014-04-03 00:16:18 +04:00
parent d84226a054
commit f648c9547c
40 changed files with 89 additions and 88 deletions
+6 -6
View File
@@ -23,16 +23,16 @@ func aptlyRepoEdit(cmd *commander.Command, args []string) error {
return fmt.Errorf("unable to edit: %s", err)
}
if cmd.Flag.Lookup("comment").Value.String() != "" {
repo.Comment = cmd.Flag.Lookup("comment").Value.String()
if context.flags.Lookup("comment").Value.String() != "" {
repo.Comment = context.flags.Lookup("comment").Value.String()
}
if cmd.Flag.Lookup("distribution").Value.String() != "" {
repo.DefaultDistribution = cmd.Flag.Lookup("distribution").Value.String()
if context.flags.Lookup("distribution").Value.String() != "" {
repo.DefaultDistribution = context.flags.Lookup("distribution").Value.String()
}
if cmd.Flag.Lookup("component").Value.String() != "" {
repo.DefaultComponent = cmd.Flag.Lookup("component").Value.String()
if context.flags.Lookup("component").Value.String() != "" {
repo.DefaultComponent = context.flags.Lookup("component").Value.String()
}
err = context.collectionFactory.LocalRepoCollection().Update(repo)