src: fail fast with conflicting flags (#348)

Signed-off-by: Lance Ball <lball@redhat.com>
This commit is contained in:
Lance Ball 2021-05-17 08:41:44 -04:00 committed by GitHub
parent a9bfb98f68
commit 2a0724083b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 2 deletions

View File

@ -99,8 +99,7 @@ func runEmit(cmd *cobra.Command, args []string) (err error) {
if config.File != "" {
var buf []byte
if emitter.Data != "" && config.Verbose {
// TODO: This made me wonder whether we should switch to a real logging library
fmt.Printf("WARN: Found both --data and --file. Using file: %v\n", config.File)
return fmt.Errorf("Only one of --data and --file may be specified \n")
}
buf, err = ioutil.ReadFile(config.File)
if err != nil {