Rename root, api and sdk module paths (imports, go.mod, go_package, ldflags, build scripts, buf configs) and regenerate protobuf/gateway code with the project's pinned toolchain. Wire identifiers unchanged. api gets a local replace for sdk; root/api/sdk require v0.1.0. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
62 lines
1.2 KiB
Go
62 lines
1.2 KiB
Go
// Copyright IBM Corp. 2020, 2026
|
|
// SPDX-License-Identifier: BUSL-1.1
|
|
|
|
package config
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"repo.anhonesthost.net/CyberCoveLLC/threshold/internal/cmd/base"
|
|
"github.com/mitchellh/cli"
|
|
)
|
|
|
|
var _ cli.Command = (*Command)(nil)
|
|
|
|
type AutocompleteCommand struct {
|
|
*base.Command
|
|
|
|
Func string
|
|
}
|
|
|
|
func (c *AutocompleteCommand) Synopsis() string {
|
|
verb := "Install"
|
|
switch c.Func {
|
|
case "uninstall":
|
|
verb = "Uninstall"
|
|
case "base":
|
|
verb = "Install or uninstall"
|
|
}
|
|
|
|
return fmt.Sprintf("%s autocompletion for Threshold's CLI", verb)
|
|
}
|
|
|
|
func (c *AutocompleteCommand) Help() string {
|
|
verb := "installs"
|
|
switch c.Func {
|
|
case "uninstall":
|
|
verb = "uninstalls"
|
|
case "base":
|
|
verb = "installs or uninstalls"
|
|
}
|
|
|
|
subcmd := ""
|
|
switch c.Func {
|
|
case "uninstall":
|
|
subcmd = " uninstall"
|
|
case "install":
|
|
subcmd = " install"
|
|
}
|
|
return base.WrapForHelpText([]string{
|
|
fmt.Sprintf("Usage: threshold config autocomplete%s [options] [args]", subcmd),
|
|
"",
|
|
fmt.Sprintf(" This command %s autocompletion support for Threshold's CLI", verb),
|
|
})
|
|
}
|
|
|
|
func (c *AutocompleteCommand) Run(args []string) int {
|
|
if len(args) > 0 {
|
|
return cli.RunResultHelp
|
|
}
|
|
return base.CommandSuccess
|
|
}
|