func init() {  
	flag.BoolVar(&cfg.version, "version", false, "print version and exit")
	flag.StringVar(&cfg.ini.source, "env", "", "path or URL to INI file with default values for unset env vars")
	flag.BoolVar(&cfg.ini.options.AllowPythonMultilineValues, "multiline", false, "allow Python-like multi-line values in INI file")
	flag.StringVar(&cfg.ini.section, "env-section", "", "section name in INI file")
	flag.Var(&cfg.ini.headers, "env-header", "`name:value` or path to file containing name:value for HTTP header to send\n(if -env is an URL)\ncan be passed multiple times")
	flag.Var(&cfg.templatePaths, "template", "template `src:dst` file or dir paths, :dst part is optional\ncan be passed multiple times")
	flag.BoolVar(&cfg.template.noOverwrite, "no-overwrite", false, "do not overwrite existing destination file from template")
	flag.BoolVar(&cfg.template.strict, "template-strict", false, "fail if template mention unset environment variable")
	flag.Var(&cfg.template.delims, "delims", "action delimiters in templates")
	flag.Var(&cfg.waitURLs, "wait", "wait for `url` (file/tcp/tcp4/tcp6/unix/http/https/amqp/amqps)\ncan be passed multiple times")
	flag.Var(&cfg.wait.headers, "wait-http-header", "`name:value` for HTTP header to send\n(if -wait use HTTP)\ncan be passed multiple times")
	flag.BoolVar(&cfg.wait.skipTLSVerify, "skip-tls-verify", false, "skip TLS verification for HTTPS/AMQPS -wait and -env urls")
	flag.StringVar(&cfg.caCert, "cacert", "", "path to CA certificate for HTTPS/AMQPS -wait and -env urls")
	flag.BoolVar(&cfg.wait.skipRedirect, "wait-http-skip-redirect", false, "do not follow HTTP redirects\n(if -wait use HTTP)")
	flag.Var(&cfg.wait.statusCodes, "wait-http-status-code", "HTTP status `code` to wait for (2xx by default)\ncan be passed multiple times")
	flag.DurationVar(&cfg.wait.timeout, "timeout", defWaitTimeout, "timeout for -wait")
	flag.DurationVar(&cfg.wait.delay, "wait-retry-interval", defWaitRetryInterval, "delay before retrying failed -wait")
	flag.Var(&cfg.tailStdout, "stdout", "file `path` to tail to stdout\ncan be passed multiple times")
	flag.Var(&cfg.tailStderr, "stderr", "file `path` to tail to stderr\ncan be passed multiple times")
	flag.IntVar(&cfg.exitCodeFatal, "exit-code", exitCodeFatal, "exit code for dockerize errors")
	flag.Usage = usage
}
One-time initialization shared with tests.
package main
import (
	"flag"
	"fmt"
	"log"
	"net/url"
	"os"
	"path"
	"runtime"
	"strings"
	"time"
)
const (
	schemeFile           = "file"
	schemeTCP            = "tcp"
	schemeTCP4           = "tcp4"
	schemeTCP6           = "tcp6"
	schemeUnix           = "unix"
	schemeHTTP           = "http"
	schemeHTTPS          = "https"
	schemeAMQP           = "amqp"
	schemeAMQPS          = "amqps"
	defWaitTimeout       = 10 * time.Second
	defWaitRetryInterval = time.Second
	exitCodeUsage        = 2
	exitCodeFatal        = 123
)
var (
	app = strings.TrimSuffix(path.Base(os.Args[0]), ".test")
	ver = "unknown"  
	cfg struct {
		version       bool
		ini           iniConfig
		templatePaths stringsFlag  
		template      templateConfig
		waitURLs      urlsFlag
		wait          waitConfig
		caCert        string
		tailStdout    stringsFlag
		tailStderr    stringsFlag
		exitCodeFatal int
	}
)