X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/0c1c09cfd0a28bcc591f4cd5e2175c63091e4e83..751cdf33d5519c393323baa15233ca55b7c7a9a1:/lib/cmd/cmd.go diff --git a/lib/cmd/cmd.go b/lib/cmd/cmd.go index 51bcf55c76..63d7576b4c 100644 --- a/lib/cmd/cmd.go +++ b/lib/cmd/cmd.go @@ -2,7 +2,7 @@ // // SPDX-License-Identifier: Apache-2.0 -// package cmd helps define reusable functions that can be exposed as +// Package cmd helps define reusable functions that can be exposed as // [subcommands of] command line programs. package cmd @@ -16,6 +16,8 @@ import ( "runtime" "sort" "strings" + + "github.com/sirupsen/logrus" ) type Handler interface { @@ -65,6 +67,11 @@ type Multi map[string]Handler func (m Multi) RunCommand(prog string, args []string, stdin io.Reader, stdout, stderr io.Writer) int { _, basename := filepath.Split(prog) + if i := strings.Index(basename, "~"); i >= 0 { + // drop "~anything" suffix (arvados-dispatch-cloud's + // DeployRunnerBinary feature relies on this) + basename = basename[:i] + } cmd, ok := m[basename] if !ok { // "controller" command exists, and binary is named "arvados-controller" @@ -148,3 +155,9 @@ func SubcommandToFront(args []string, flagset FlagSet) []string { copy(newargs[flagargs+1:], args[flagargs+1:]) return newargs } + +type NoPrefixFormatter struct{} + +func (NoPrefixFormatter) Format(entry *logrus.Entry) ([]byte, error) { + return []byte(entry.Message + "\n"), nil +}