fix(cli): honor local installation discovery precedence
This commit is contained in:
@@ -81,11 +81,11 @@ func run(ctx context.Context, args []string, stdout, stderr io.Writer) int {
|
||||
fmt.Fprintf(stderr, "tht: %s\n\n%s", err, usage)
|
||||
return 2
|
||||
}
|
||||
if command == "help" && len(commandArgs) == 0 {
|
||||
fmt.Fprint(stdout, usage)
|
||||
return 0
|
||||
}
|
||||
if (command == "version" || command == "setup") && len(commandArgs) == 0 {
|
||||
if isBootstrapCommand(command) {
|
||||
if command == "help" {
|
||||
fmt.Fprint(stdout, usage)
|
||||
return 0
|
||||
}
|
||||
return commandUsageError(stderr, fmt.Sprintf("unknown command %q", command))
|
||||
}
|
||||
workingDirectory, err := os.Getwd()
|
||||
@@ -194,6 +194,10 @@ func run(ctx context.Context, args []string, stdout, stderr io.Writer) int {
|
||||
return writeResult(result, err, secretValues, stdout, stderr)
|
||||
}
|
||||
|
||||
func isBootstrapCommand(command string) bool {
|
||||
return command == "help" || command == "setup" || command == "version"
|
||||
}
|
||||
|
||||
func writeRemovalTargets(outputWriter io.Writer, project string, targets []serverops.Container) {
|
||||
fmt.Fprintf(outputWriter, "Removal targets for installation project %s:\n", project)
|
||||
if len(targets) == 0 {
|
||||
|
||||
Reference in New Issue
Block a user