Merge pull request #6584 from dokku/6422-update-help
fix: use new CallExecCommand when checking to see how help is being called
This commit is contained in:
16 files changed
+114
-82
No files matched your search
@@ -32,11 +32,13 @@ func main() {
|
|||||||
case "app-json", "app-json:help":
|
case "app-json", "app-json:help":
|
||||||
usage()
|
usage()
|
||||||
case "help":
|
case "help":
|
||||||
command := common.NewShellCmd(fmt.Sprintf("ps -o command= %d", os.Getppid()))
|
result, err := common.CallExecCommand(common.ExecCommandInput{
|
||||||
command.ShowOutput = false
|
Command: "ps",
|
||||||
output, err := command.Output()
|
Args: []string{"-o", "command=", strconv.Itoa(os.Getppid())},
|
||||||
|
CaptureOutput: true,
|
||||||
if err == nil && strings.Contains(string(output), "--all") {
|
StreamStdio: false,
|
||||||
|
})
|
||||||
|
if err == nil && strings.Contains(result.StdoutContents(), "--all") {
|
||||||
fmt.Println(helpContent)
|
fmt.Println(helpContent)
|
||||||
} else {
|
} else {
|
||||||
fmt.Print("\n app-json, Manage app-json settings for an app\n")
|
fmt.Print("\n app-json, Manage app-json settings for an app\n")
|
||||||
|
|||||||
@@ -49,11 +49,13 @@ func main() {
|
|||||||
case "apps:help":
|
case "apps:help":
|
||||||
usage()
|
usage()
|
||||||
case "help":
|
case "help":
|
||||||
command := common.NewShellCmd(fmt.Sprintf("ps -o command= %d", os.Getppid()))
|
result, err := common.CallExecCommand(common.ExecCommandInput{
|
||||||
command.ShowOutput = false
|
Command: "ps",
|
||||||
output, err := command.Output()
|
Args: []string{"-o", "command=", strconv.Itoa(os.Getppid())},
|
||||||
|
CaptureOutput: true,
|
||||||
if err == nil && strings.Contains(string(output), "--all") {
|
StreamStdio: false,
|
||||||
|
})
|
||||||
|
if err == nil && strings.Contains(result.StdoutContents(), "--all") {
|
||||||
fmt.Println(helpContent)
|
fmt.Println(helpContent)
|
||||||
} else {
|
} else {
|
||||||
fmt.Print("\n apps, Manage apps\n")
|
fmt.Print("\n apps, Manage apps\n")
|
||||||
|
|||||||
@@ -32,11 +32,13 @@ func main() {
|
|||||||
case "builder", "builder:help":
|
case "builder", "builder:help":
|
||||||
usage()
|
usage()
|
||||||
case "help":
|
case "help":
|
||||||
command := common.NewShellCmd(fmt.Sprintf("ps -o command= %d", os.Getppid()))
|
result, err := common.CallExecCommand(common.ExecCommandInput{
|
||||||
command.ShowOutput = false
|
Command: "ps",
|
||||||
output, err := command.Output()
|
Args: []string{"-o", "command=", strconv.Itoa(os.Getppid())},
|
||||||
|
CaptureOutput: true,
|
||||||
if err == nil && strings.Contains(string(output), "--all") {
|
StreamStdio: false,
|
||||||
|
})
|
||||||
|
if err == nil && strings.Contains(result.StdoutContents(), "--all") {
|
||||||
fmt.Println(helpContent)
|
fmt.Println(helpContent)
|
||||||
} else {
|
} else {
|
||||||
fmt.Print("\n builder, Manage builder settings for an app\n")
|
fmt.Print("\n builder, Manage builder settings for an app\n")
|
||||||
|
|||||||
@@ -37,11 +37,13 @@ func main() {
|
|||||||
case "buildpacks", "buildpacks:help":
|
case "buildpacks", "buildpacks:help":
|
||||||
usage()
|
usage()
|
||||||
case "help":
|
case "help":
|
||||||
command := common.NewShellCmd(fmt.Sprintf("ps -o command= %d", os.Getppid()))
|
result, err := common.CallExecCommand(common.ExecCommandInput{
|
||||||
command.ShowOutput = false
|
Command: "ps",
|
||||||
output, err := command.Output()
|
Args: []string{"-o", "command=", strconv.Itoa(os.Getppid())},
|
||||||
|
CaptureOutput: true,
|
||||||
if err == nil && strings.Contains(string(output), "--all") {
|
StreamStdio: false,
|
||||||
|
})
|
||||||
|
if err == nil && strings.Contains(result.StdoutContents(), "--all") {
|
||||||
fmt.Println(helpContent)
|
fmt.Println(helpContent)
|
||||||
} else {
|
} else {
|
||||||
fmt.Print("\n buildpacks, Manage buildpack settings for an app\n")
|
fmt.Print("\n buildpacks, Manage buildpack settings for an app\n")
|
||||||
|
|||||||
@@ -53,11 +53,13 @@ func main() {
|
|||||||
case "config:help":
|
case "config:help":
|
||||||
usage()
|
usage()
|
||||||
case "help":
|
case "help":
|
||||||
command := common.NewShellCmd(fmt.Sprintf("ps -o command= %d", os.Getppid()))
|
result, err := common.CallExecCommand(common.ExecCommandInput{
|
||||||
command.ShowOutput = false
|
Command: "ps",
|
||||||
output, err := command.Output()
|
Args: []string{"-o", "command=", strconv.Itoa(os.Getppid())},
|
||||||
|
CaptureOutput: true,
|
||||||
if err == nil && strings.Contains(string(output), "--all") {
|
StreamStdio: false,
|
||||||
|
})
|
||||||
|
if err == nil && strings.Contains(result.StdoutContents(), "--all") {
|
||||||
fmt.Println(helpContent)
|
fmt.Println(helpContent)
|
||||||
} else {
|
} else {
|
||||||
fmt.Print("\n config, Manage global and app-specific config vars\n")
|
fmt.Print("\n config, Manage global and app-specific config vars\n")
|
||||||
|
|||||||
@@ -33,11 +33,13 @@ func main() {
|
|||||||
case "cron", "cron:help":
|
case "cron", "cron:help":
|
||||||
usage()
|
usage()
|
||||||
case "help":
|
case "help":
|
||||||
command := common.NewShellCmd(fmt.Sprintf("ps -o command= %d", os.Getppid()))
|
result, err := common.CallExecCommand(common.ExecCommandInput{
|
||||||
command.ShowOutput = false
|
Command: "ps",
|
||||||
output, err := command.Output()
|
Args: []string{"-o", "command=", strconv.Itoa(os.Getppid())},
|
||||||
|
CaptureOutput: true,
|
||||||
if err == nil && strings.Contains(string(output), "--all") {
|
StreamStdio: false,
|
||||||
|
})
|
||||||
|
if err == nil && strings.Contains(result.StdoutContents(), "--all") {
|
||||||
fmt.Println(helpContent)
|
fmt.Println(helpContent)
|
||||||
} else {
|
} else {
|
||||||
fmt.Print("\n cron, Manage scheduled cron tasks\n")
|
fmt.Print("\n cron, Manage scheduled cron tasks\n")
|
||||||
|
|||||||
@@ -59,11 +59,13 @@ func main() {
|
|||||||
case "logs:help":
|
case "logs:help":
|
||||||
usage()
|
usage()
|
||||||
case "help":
|
case "help":
|
||||||
command := common.NewShellCmd(fmt.Sprintf("ps -o command= %d", os.Getppid()))
|
result, err := common.CallExecCommand(common.ExecCommandInput{
|
||||||
command.ShowOutput = false
|
Command: "ps",
|
||||||
output, err := command.Output()
|
Args: []string{"-o", "command=", strconv.Itoa(os.Getppid())},
|
||||||
|
CaptureOutput: true,
|
||||||
if err == nil && strings.Contains(string(output), "--all") {
|
StreamStdio: false,
|
||||||
|
})
|
||||||
|
if err == nil && strings.Contains(result.StdoutContents(), "--all") {
|
||||||
fmt.Println(helpContent)
|
fmt.Println(helpContent)
|
||||||
} else {
|
} else {
|
||||||
fmt.Print("\n logs, Manage log integration for an app\n")
|
fmt.Print("\n logs, Manage log integration for an app\n")
|
||||||
|
|||||||
@@ -39,11 +39,13 @@ func main() {
|
|||||||
case "network", "network:help":
|
case "network", "network:help":
|
||||||
usage()
|
usage()
|
||||||
case "help":
|
case "help":
|
||||||
command := common.NewShellCmd(fmt.Sprintf("ps -o command= %d", os.Getppid()))
|
result, err := common.CallExecCommand(common.ExecCommandInput{
|
||||||
command.ShowOutput = false
|
Command: "ps",
|
||||||
output, err := command.Output()
|
Args: []string{"-o", "command=", strconv.Itoa(os.Getppid())},
|
||||||
|
CaptureOutput: true,
|
||||||
if err == nil && strings.Contains(string(output), "--all") {
|
StreamStdio: false,
|
||||||
|
})
|
||||||
|
if err == nil && strings.Contains(result.StdoutContents(), "--all") {
|
||||||
fmt.Println(helpContent)
|
fmt.Println(helpContent)
|
||||||
} else {
|
} else {
|
||||||
fmt.Print("\n network, Manage network settings for an app\n")
|
fmt.Print("\n network, Manage network settings for an app\n")
|
||||||
|
|||||||
@@ -36,11 +36,13 @@ func main() {
|
|||||||
case "ports", "ports:help":
|
case "ports", "ports:help":
|
||||||
usage()
|
usage()
|
||||||
case "help":
|
case "help":
|
||||||
command := common.NewShellCmd(fmt.Sprintf("ps -o command= %d", os.Getppid()))
|
result, err := common.CallExecCommand(common.ExecCommandInput{
|
||||||
command.ShowOutput = false
|
Command: "ps",
|
||||||
output, err := command.Output()
|
Args: []string{"-o", "command=", strconv.Itoa(os.Getppid())},
|
||||||
|
CaptureOutput: true,
|
||||||
if err == nil && strings.Contains(string(output), "--all") {
|
StreamStdio: false,
|
||||||
|
})
|
||||||
|
if err == nil && strings.Contains(result.StdoutContents(), "--all") {
|
||||||
fmt.Println(helpContent)
|
fmt.Println(helpContent)
|
||||||
} else {
|
} else {
|
||||||
fmt.Print("\n ports, Manage ports for an app\n")
|
fmt.Print("\n ports, Manage ports for an app\n")
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ Manage the proxy integration for an app
|
|||||||
Additional commands:`
|
Additional commands:`
|
||||||
|
|
||||||
helpContent = `
|
helpContent = `
|
||||||
proxy:build-config [--parallel count] [--all|<app>], (Re)builds config for a given app
|
proxy:build-config [--parallel count] [--all|<app>], (Re)builds config for a given app
|
||||||
proxy:clear-config [--all|<app>], Clears config for a given app
|
proxy:clear-config [--all|<app>], Clears config for a given app
|
||||||
proxy:disable <app>, Disable proxy for app
|
proxy:disable <app>, Disable proxy for app
|
||||||
proxy:enable <app>, Enable proxy for app
|
proxy:enable <app>, Enable proxy for app
|
||||||
proxy:report [<app>] [<flag>], Displays a proxy report for one or more apps
|
proxy:report [<app>] [<flag>], Displays a proxy report for one or more apps
|
||||||
@@ -36,11 +36,13 @@ func main() {
|
|||||||
case "proxy", "proxy:help":
|
case "proxy", "proxy:help":
|
||||||
usage()
|
usage()
|
||||||
case "help":
|
case "help":
|
||||||
command := common.NewShellCmd(fmt.Sprintf("ps -o command= %d", os.Getppid()))
|
result, err := common.CallExecCommand(common.ExecCommandInput{
|
||||||
command.ShowOutput = false
|
Command: "ps",
|
||||||
output, err := command.Output()
|
Args: []string{"-o", "command=", strconv.Itoa(os.Getppid())},
|
||||||
|
CaptureOutput: true,
|
||||||
if err == nil && strings.Contains(string(output), "--all") {
|
StreamStdio: false,
|
||||||
|
})
|
||||||
|
if err == nil && strings.Contains(result.StdoutContents(), "--all") {
|
||||||
fmt.Println(helpContent)
|
fmt.Println(helpContent)
|
||||||
} else {
|
} else {
|
||||||
fmt.Print("\n proxy, Manage the proxy integration for an app\n")
|
fmt.Print("\n proxy, Manage the proxy integration for an app\n")
|
||||||
|
|||||||
@@ -39,11 +39,13 @@ func main() {
|
|||||||
case "ps", "ps:help":
|
case "ps", "ps:help":
|
||||||
usage()
|
usage()
|
||||||
case "help":
|
case "help":
|
||||||
command := common.NewShellCmd(fmt.Sprintf("ps -o command= %d", os.Getppid()))
|
result, err := common.CallExecCommand(common.ExecCommandInput{
|
||||||
command.ShowOutput = false
|
Command: "ps",
|
||||||
output, err := command.Output()
|
Args: []string{"-o", "command=", strconv.Itoa(os.Getppid())},
|
||||||
|
CaptureOutput: true,
|
||||||
if err == nil && strings.Contains(string(output), "--all") {
|
StreamStdio: false,
|
||||||
|
})
|
||||||
|
if err == nil && strings.Contains(result.StdoutContents(), "--all") {
|
||||||
fmt.Println(helpContent)
|
fmt.Println(helpContent)
|
||||||
} else {
|
} else {
|
||||||
fmt.Print("\n ps, Manage app processes\n")
|
fmt.Print("\n ps, Manage app processes\n")
|
||||||
|
|||||||
@@ -33,11 +33,13 @@ func main() {
|
|||||||
case "registry", "registry:help":
|
case "registry", "registry:help":
|
||||||
usage()
|
usage()
|
||||||
case "help":
|
case "help":
|
||||||
command := common.NewShellCmd(fmt.Sprintf("ps -o command= %d", os.Getppid()))
|
result, err := common.CallExecCommand(common.ExecCommandInput{
|
||||||
command.ShowOutput = false
|
Command: "ps",
|
||||||
output, err := command.Output()
|
Args: []string{"-o", "command=", strconv.Itoa(os.Getppid())},
|
||||||
|
CaptureOutput: true,
|
||||||
if err == nil && strings.Contains(string(output), "--all") {
|
StreamStdio: false,
|
||||||
|
})
|
||||||
|
if err == nil && strings.Contains(result.StdoutContents(), "--all") {
|
||||||
fmt.Println(helpContent)
|
fmt.Println(helpContent)
|
||||||
} else {
|
} else {
|
||||||
fmt.Print("\n registry, Manage registry settings for an app\n")
|
fmt.Print("\n registry, Manage registry settings for an app\n")
|
||||||
|
|||||||
@@ -32,11 +32,13 @@ func main() {
|
|||||||
case "repo", "repo:help":
|
case "repo", "repo:help":
|
||||||
usage()
|
usage()
|
||||||
case "help":
|
case "help":
|
||||||
command := common.NewShellCmd(fmt.Sprintf("ps -o command= %d", os.Getppid()))
|
result, err := common.CallExecCommand(common.ExecCommandInput{
|
||||||
command.ShowOutput = false
|
Command: "ps",
|
||||||
output, err := command.Output()
|
Args: []string{"-o", "command=", strconv.Itoa(os.Getppid())},
|
||||||
|
CaptureOutput: true,
|
||||||
if err == nil && strings.Contains(string(output), "--all") {
|
StreamStdio: false,
|
||||||
|
})
|
||||||
|
if err == nil && strings.Contains(result.StdoutContents(), "--all") {
|
||||||
fmt.Println(helpContent)
|
fmt.Println(helpContent)
|
||||||
} else {
|
} else {
|
||||||
fmt.Print("\n repo, Manage the app's repo\n")
|
fmt.Print("\n repo, Manage the app's repo\n")
|
||||||
|
|||||||
@@ -35,11 +35,13 @@ func main() {
|
|||||||
case "resource", "resource:help":
|
case "resource", "resource:help":
|
||||||
usage()
|
usage()
|
||||||
case "help":
|
case "help":
|
||||||
command := common.NewShellCmd(fmt.Sprintf("ps -o command= %d", os.Getppid()))
|
result, err := common.CallExecCommand(common.ExecCommandInput{
|
||||||
command.ShowOutput = false
|
Command: "ps",
|
||||||
output, err := command.Output()
|
Args: []string{"-o", "command=", strconv.Itoa(os.Getppid())},
|
||||||
|
CaptureOutput: true,
|
||||||
if err == nil && strings.Contains(string(output), "--all") {
|
StreamStdio: false,
|
||||||
|
})
|
||||||
|
if err == nil && strings.Contains(result.StdoutContents(), "--all") {
|
||||||
fmt.Println(helpContent)
|
fmt.Println(helpContent)
|
||||||
} else {
|
} else {
|
||||||
fmt.Print("\n resource, Manage resource settings for an app\n")
|
fmt.Print("\n resource, Manage resource settings for an app\n")
|
||||||
|
|||||||
@@ -42,11 +42,13 @@ func main() {
|
|||||||
case "scheduler-k3s", "scheduler-k3s:help":
|
case "scheduler-k3s", "scheduler-k3s:help":
|
||||||
usage()
|
usage()
|
||||||
case "help":
|
case "help":
|
||||||
command := common.NewShellCmd(fmt.Sprintf("ps -o command= %d", os.Getppid()))
|
result, err := common.CallExecCommand(common.ExecCommandInput{
|
||||||
command.ShowOutput = false
|
Command: "ps",
|
||||||
output, err := command.Output()
|
Args: []string{"-o", "command=", strconv.Itoa(os.Getppid())},
|
||||||
|
CaptureOutput: true,
|
||||||
if err == nil && strings.Contains(string(output), "--all") {
|
StreamStdio: false,
|
||||||
|
})
|
||||||
|
if err == nil && strings.Contains(result.StdoutContents(), "--all") {
|
||||||
fmt.Println(helpContent)
|
fmt.Println(helpContent)
|
||||||
} else {
|
} else {
|
||||||
fmt.Print("\n scheduler-k3s, Manage scheduler-k3s settings for an app\n")
|
fmt.Print("\n scheduler-k3s, Manage scheduler-k3s settings for an app\n")
|
||||||
|
|||||||
@@ -32,11 +32,13 @@ func main() {
|
|||||||
case "scheduler", "scheduler:help":
|
case "scheduler", "scheduler:help":
|
||||||
usage()
|
usage()
|
||||||
case "help":
|
case "help":
|
||||||
command := common.NewShellCmd(fmt.Sprintf("ps -o command= %d", os.Getppid()))
|
result, err := common.CallExecCommand(common.ExecCommandInput{
|
||||||
command.ShowOutput = false
|
Command: "ps",
|
||||||
output, err := command.Output()
|
Args: []string{"-o", "command=", strconv.Itoa(os.Getppid())},
|
||||||
|
CaptureOutput: true,
|
||||||
if err == nil && strings.Contains(string(output), "--all") {
|
StreamStdio: false,
|
||||||
|
})
|
||||||
|
if err == nil && strings.Contains(result.StdoutContents(), "--all") {
|
||||||
fmt.Println(helpContent)
|
fmt.Println(helpContent)
|
||||||
} else {
|
} else {
|
||||||
fmt.Print("\n scheduler, Manage scheduler settings for an app\n")
|
fmt.Print("\n scheduler, Manage scheduler settings for an app\n")
|
||||||
|
|||||||
Reference in new issue
Block a user