Skip to content

Commit

Permalink
Add interactive mode to manage command
Browse files Browse the repository at this point in the history
Signed-off-by: Ondrej Fabry <ondrej.fabry@pantheon.tech>
  • Loading branch information
ondrej-fabry committed Apr 26, 2023
1 parent 7aa3144 commit 7eaf422
Show file tree
Hide file tree
Showing 11 changed files with 322 additions and 160 deletions.
4 changes: 4 additions & 0 deletions cmd/swctl/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ import (
"go.pantheon.tech/stonework/client"
)

// TODO: to be refactored:
// - refactor the usage of external apps: agentctl, vpp-probe
// - set the log level / debug mode on the external apps to match the swctl settings

// Cli is a client API for CLI application.
type Cli interface {
Initialize(opts Options) error
Expand Down
6 changes: 4 additions & 2 deletions cmd/swctl/cmd_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import (
"github.com/spf13/cobra"
)

// TODO: add support for showing only non-internal user config - which excludes stonework-CNF wiring (punts)
// TODO:
// - internal config: add support for showing only non-internal user config - which excludes stonework-CNF wiring (punts)
// - run the agentctl with the default host set to stonework (using the -H or running inside stonework image)

type ConfigCmdOptions struct {
Args []string
Expand Down Expand Up @@ -36,7 +38,7 @@ func runConfigCmd(cli Cli, opts ConfigCmdOptions) error {
if err != nil {
return err
}

fmt.Fprintln(cli.Out(), out)
return nil
}
7 changes: 5 additions & 2 deletions cmd/swctl/cmd_deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ const deploymentExample = `

func NewDeploymentCmd(cli Cli) *cobra.Command {
cmd := &cobra.Command{
Use: "deployment [flags] COMMAND",
Short: "Manage deployments of StoneWork",
Use: "deployment [flags] COMMAND",
Short: "Manage deployments of StoneWork",
Long: `Command deploy manages deployment of StoneWork.
It hides the specifics of a deployment and provides unified interface to user.
Currently only Docker Compose is supported, for which the deploy command offers a wrapper.`,
Example: color.Sprint(deploymentExample),
Aliases: []string{"deploy"},
Args: cobra.ArbitraryArgs,
Expand Down
Loading

0 comments on commit 7eaf422

Please sign in to comment.