Correctly parse boolean flags in combination with config options. #104

Config option should act as default, while flag should override it only if set.
This commit is contained in:
Andrey Smirnov
2014-09-22 13:41:26 +04:00
parent 9c92b81706
commit 5e1bd0ff0e
8 changed files with 39 additions and 8 deletions

View File

@@ -16,7 +16,7 @@ func aptlyMirrorCreate(cmd *commander.Command, args []string) error {
return commander.ErrCommandError
}
downloadSources := context.Config().DownloadSourcePackages || context.flags.Lookup("with-sources").Value.Get().(bool)
downloadSources := LookupOption(context.Config().DownloadSourcePackages, context.flags, "with-sources")
var (
mirrorName, archiveURL, distribution string