UPSTREAM: <carry>: allow to override command name
@@ -282,6 +282,9 @@ func adjustVersion(v string) string {
return seg[0]
}
+// CommandNameOverride allows to override the command reported in user-agent.
+var CommandNameOverride = ""
+
// adjustCommand returns the last component of the
// OS-specific command path for use in User-Agent.
func adjustCommand(p string) string {
@@ -289,6 +292,9 @@ func adjustCommand(p string) string {
if len(p) == 0 {
return "unknown"
}
+ if len(CommandNameOverride) > 0 {
+ return CommandNameOverride
+ }
return filepath.Base(p)
}
