Moves files

This commit is contained in:
Alexander Neumann committed 2017-07-23 14:19:13 +02:00
1 parent d1bd160b0a
commit 83d1a46526
284 files changed

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
package main
import (
"io/ioutil"
"testing"
)
// TestFlags checks for double defined flags, the commands will panic on
// ParseFlags() when a shorthand flag is defined twice.
func TestFlags(t *testing.T) {
for _, cmd := range cmdRoot.Commands() {
t.Run(cmd.Name(), func(t *testing.T) {
cmd.Flags().SetOutput(ioutil.Discard)
err := cmd.ParseFlags([]string{"--help"})
if err.Error() == "pflag: help requested" {
err = nil
}
if err != nil {
t.Fatal(err)
}
})
}
}