Skip to content

Commit 6d43f8f

Browse files
author
Michael Persson
committed
Set validation using Env. var ETCDTOOL_VALIDATE=true
1 parent 78801d3 commit 6d43f8f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/github.com/mickep76/etcdtool/command/edit_command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ func NewEditCommand() cli.Command {
1919
cli.BoolFlag{Name: "sort, s", Usage: "returns result in sorted order"},
2020
cli.BoolFlag{Name: "yes, y", Usage: "Answer yes to any questions"},
2121
cli.BoolFlag{Name: "replace, r", Usage: "Replace data"},
22-
cli.BoolFlag{Name: "validate, v", Usage: "Validate data before import"},
22+
cli.BoolFlag{Name: "validate, v", EnvVar: "ETCDTOOL_VALIDATE", Usage: "Validate data before import"},
2323
cli.StringFlag{Name: "format, f", Value: "JSON", EnvVar: "ETCDTOOL_FORMAT", Usage: "Data serialization format YAML, TOML or JSON"},
2424
cli.StringFlag{Name: "editor, e", Value: "vim", Usage: "Editor", EnvVar: "EDITOR"},
2525
cli.StringFlag{Name: "tmp-file, t", Value: ".etcdtool.swp", Usage: "Temporary file"},

src/github.com/mickep76/etcdtool/command/import_command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func NewImportCommand() cli.Command {
2222
Flags: []cli.Flag{
2323
cli.BoolFlag{Name: "yes, y", Usage: "Answer yes to any questions"},
2424
cli.BoolFlag{Name: "replace, r", Usage: "Replace data"},
25-
cli.BoolFlag{Name: "validate, v", Usage: "Validate data before import"},
25+
cli.BoolFlag{Name: "validate, v", EnvVar: "ETCDTOOL_VALIDATE", Usage: "Validate data before import"},
2626
cli.StringFlag{Name: "format, f", Value: "JSON", EnvVar: "ETCDTOOL_FORMAT", Usage: "Data serialization format YAML, TOML or JSON"},
2727
},
2828
Action: func(c *cli.Context) {

0 commit comments

Comments
 (0)