5 Commits

Author SHA1 Message Date
Anthony Sterling
bc20d5071b Release 202008101504
Some checks failed
goreleaser / goreleaser (push) Has been cancelled
2020-08-10 15:04:52 +01:00
Anthony Sterling
27d5069550 Merge pull request #6 from chrisgavin/fix-incorrect-message
Fix some incorrect error messages.
2020-08-10 14:51:08 +01:00
Anthony Sterling
8cdfdec64a Merge pull request #7 from chrisgavin/fix-cache-dir-not-required
Fix `--cache-dir` not actually being marked as a required flag.
2020-08-10 14:50:50 +01:00
Chris Gavin
732ce15227 Fix some incorrect error messages. 2020-08-06 15:03:38 +01:00
Chris Gavin
7f01c4dc4d Fix --cache-dir not actually being marked as a required flag. 2020-08-06 14:58:30 +01:00
3 changed files with 4 additions and 4 deletions

View File

@@ -86,7 +86,7 @@ var (
func Execute(ctx context.Context) error {
rootCmd.PersistentFlags().StringVar(&cacheDir, "cache-dir", "", "Directory containing the repopositories cache created by the `pull` command")
_ = rootCmd.MarkFlagRequired("cache-dir")
_ = rootCmd.MarkPersistentFlagRequired("cache-dir")
rootCmd.AddCommand(versionCmd)

View File

@@ -34,7 +34,7 @@ func (f *PullFlags) Init(cmd *cobra.Command) {
func (f *PullFlags) Validate() Validations {
var validations Validations
if !f.HasAtLeastOneRepoFlag() {
validations = append(validations, "one of -repo-name, -repo-name-list, -repo-name-list-file must be set")
validations = append(validations, "one of --repo-name, --repo-name-list, --repo-name-list-file must be set")
}
return validations
}

View File

@@ -30,10 +30,10 @@ func (f *PushFlags) Init(cmd *cobra.Command) {
func (f *PushFlags) Validate() Validations {
var validations Validations
if f.BaseURL == "" {
validations = append(validations, "-baseURL must be set")
validations = append(validations, "--destination-url must be set")
}
if f.Token == "" {
validations = append(validations, "-token must be set")
validations = append(validations, "--destination-token must be set")
}
return validations
}