Make --validate default on and shows how to turn if off

This commit is contained in:
Janet Kuo
2015-08-17 18:15:34 -07:00
parent 4d10def14f
commit 5823ef771b
73 changed files with 1247 additions and 206 deletions

View File

@@ -259,6 +259,10 @@ func GetFlagDuration(cmd *cobra.Command, flag string) time.Duration {
return d
}
func AddValidateFlag(cmd *cobra.Command) {
cmd.Flags().Bool("validate", true, "If true, use a schema to validate the input before sending it")
}
func ReadConfigDataFromReader(reader io.Reader, source string) ([]byte, error) {
data, err := ioutil.ReadAll(reader)
if err != nil {