435c0d9fc8
This PR switches the Nomad repository from using govendor to Go modules for managing dependencies. Aspects of the Nomad workflow remain pretty much the same. The usual Makefile targets should continue to work as they always did. The API submodule simply defers to the parent Nomad version on the repository, keeping the semantics of API versioning that currently exists.
23 lines
553 B
Go
23 lines
553 B
Go
package complete
|
|
|
|
import (
|
|
"io/ioutil"
|
|
"log"
|
|
"os"
|
|
)
|
|
|
|
// Log is used for debugging purposes
|
|
// since complete is running on tab completion, it is nice to
|
|
// have logs to the stderr (when writing your own completer)
|
|
// to write logs, set the COMP_DEBUG environment variable and
|
|
// use complete.Log in the complete program
|
|
var Log = getLogger()
|
|
|
|
func getLogger() func(format string, args ...interface{}) {
|
|
var logfile = ioutil.Discard
|
|
if os.Getenv(envDebug) != "" {
|
|
logfile = os.Stderr
|
|
}
|
|
return log.New(logfile, "complete ", log.Flags()).Printf
|
|
}
|