X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/917330c81bb370225ccd0e051dbdca3d1870710e..5b554bbe0b9104e8a34b87d5570cbf87f0308bce:/lib/costanalyzer/cmd.go diff --git a/lib/costanalyzer/cmd.go b/lib/costanalyzer/cmd.go index 9b0685225b..525ec619b5 100644 --- a/lib/costanalyzer/cmd.go +++ b/lib/costanalyzer/cmd.go @@ -6,15 +6,21 @@ package costanalyzer import ( "io" + "time" - "git.arvados.org/arvados.git/lib/config" "git.arvados.org/arvados.git/sdk/go/ctxlog" "github.com/sirupsen/logrus" ) -var Command command +var Command = command{} -type command struct{} +type command struct { + uuids arrayFlags + resultsDir string + cache bool + begin time.Time + end time.Time +} type NoPrefixFormatter struct{} @@ -23,7 +29,7 @@ func (f *NoPrefixFormatter) Format(entry *logrus.Entry) ([]byte, error) { } // RunCommand implements the subcommand "costanalyzer ..." -func (command) RunCommand(prog string, args []string, stdin io.Reader, stdout, stderr io.Writer) int { +func (c command) RunCommand(prog string, args []string, stdin io.Reader, stdout, stderr io.Writer) int { var err error logger := ctxlog.New(stderr, "text", "info") defer func() { @@ -34,10 +40,7 @@ func (command) RunCommand(prog string, args []string, stdin io.Reader, stdout, s logger.SetFormatter(new(NoPrefixFormatter)) - loader := config.NewLoader(stdin, logger) - loader.SkipLegacy = true - - exitcode, err := costanalyzer(prog, args, loader, logger, stdout, stderr) + exitcode, err := c.costAnalyzer(prog, args, logger, stdout, stderr) return exitcode }