X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/21dfd2339fb0a4f501b43beedf3207c5d30aae1b..dc543546ef67fc3a7aca4b8208cafe64c94f3731:/lib/config/cmd.go?ds=sidebyside diff --git a/lib/config/cmd.go b/lib/config/cmd.go index 858bfc2b26..0351ad02a1 100644 --- a/lib/config/cmd.go +++ b/lib/config/cmd.go @@ -13,13 +13,12 @@ import ( "os" "os/exec" - "git.curoverse.com/arvados.git/lib/cmd" "git.curoverse.com/arvados.git/sdk/go/arvados" "git.curoverse.com/arvados.git/sdk/go/ctxlog" "github.com/ghodss/yaml" ) -var DumpCommand cmd.Handler = dumpCommand{} +var DumpCommand dumpCommand type dumpCommand struct{} @@ -62,7 +61,7 @@ func (dumpCommand) RunCommand(prog string, args []string, stdin io.Reader, stdou return 0 } -var CheckCommand cmd.Handler = checkCommand{} +var CheckCommand checkCommand type checkCommand struct{} @@ -147,3 +146,22 @@ func (pl *plainLogger) Warnf(format string, args ...interface{}) { pl.used = true fmt.Fprintf(pl.w, format+"\n", args...) } + +var DumpDefaultsCommand defaultsCommand + +type defaultsCommand struct{} + +func (defaultsCommand) RunCommand(prog string, args []string, stdin io.Reader, stdout, stderr io.Writer) int { + var err error + defer func() { + if err != nil { + fmt.Fprintf(stderr, "%s\n", err) + } + }() + + _, err = stdout.Write(DefaultYAML) + if err != nil { + return 1 + } + return 0 +}