projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
17778: update docs.
[arvados.git]
/
lib
/
costanalyzer
/
cmd.go
diff --git
a/lib/costanalyzer/cmd.go
b/lib/costanalyzer/cmd.go
index 800860ddf490b8a4b1186f823e58d7c7efe35f74..525ec619b5e4aeeb0b4e271704f13385a41bcefd 100644
(file)
--- a/
lib/costanalyzer/cmd.go
+++ b/
lib/costanalyzer/cmd.go
@@
-6,15
+6,21
@@
package costanalyzer
import (
"io"
import (
"io"
+ "time"
- "git.arvados.org/arvados.git/lib/config"
"git.arvados.org/arvados.git/sdk/go/ctxlog"
"github.com/sirupsen/logrus"
)
"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{}
type NoPrefixFormatter struct{}
@@
-23,7
+29,7
@@
func (f *NoPrefixFormatter) Format(entry *logrus.Entry) ([]byte, error) {
}
// RunCommand implements the subcommand "costanalyzer <collection> <collection> ..."
}
// RunCommand implements the subcommand "costanalyzer <collection> <collection> ..."
-func (command) RunCommand(prog string, args []string, stdin io.Reader, stdout, stderr io.Writer) int {
+func (c
c
ommand) RunCommand(prog string, args []string, stdin io.Reader, stdout, stderr io.Writer) int {
var err error
logger := ctxlog.New(stderr, "text", "info")
defer func() {
var err error
logger := ctxlog.New(stderr, "text", "info")
defer func() {
@@
-33,12
+39,8
@@
func (command) RunCommand(prog string, args []string, stdin io.Reader, stdout, s
}()
logger.SetFormatter(new(NoPrefixFormatter))
}()
logger.SetFormatter(new(NoPrefixFormatter))
- logger.SetOutput(stdout)
-
- loader := config.NewLoader(stdin, logger)
- loader.SkipLegacy = true
- exitcode, err := c
ostanalyzer(prog, args, loader
, logger, stdout, stderr)
+ exitcode, err := c
.costAnalyzer(prog, args
, logger, stdout, stderr)
return exitcode
}
return exitcode
}