Skip to content

Commit

Permalink
Do some CLI tidying. Fixes #1921
Browse files Browse the repository at this point in the history
* Remove version, use, install and upgrade commands
* Replace version with command which outputs CLI version
* Remove redundant version commands
* Remove ziti fabric add/remove-identity commands
* Remove lots of unused code
* Remove 'ziti tunnel enroll' command, which is replaced by 'ziti edge enroll'
  • Loading branch information
plorenz authored and qrkourier committed Apr 11, 2024
1 parent 43c785d commit fdbc327
Show file tree
Hide file tree
Showing 43 changed files with 50 additions and 3,482 deletions.
13 changes: 1 addition & 12 deletions ziti/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
"github.com/openziti/ziti/ziti/cmd/demo"
"github.com/openziti/ziti/ziti/cmd/edge"
"github.com/openziti/ziti/ziti/cmd/fabric"
"github.com/openziti/ziti/ziti/cmd/install"
"github.com/openziti/ziti/ziti/cmd/pki"
"github.com/openziti/ziti/ziti/cmd/templates"
c "github.com/openziti/ziti/ziti/constants"
Expand Down Expand Up @@ -143,18 +142,7 @@ func NewCmdRoot(in io.Reader, out, err io.Writer, cmd *cobra.Command) *cobra.Com
opsCommands.AddCommand(NewCmdLogFormat(out, err))
opsCommands.AddCommand(NewUnwrapIdentityFileCommand(out, err))

installCommands := []*cobra.Command{
install.NewCmdInstall(out, err),
install.NewCmdUpgrade(out, err),
install.NewCmdUse(out, err),
install.NewCmdVersion(out, err),
}

groups := templates.CommandGroups{
{
Message: "Installing Ziti components:",
Commands: installCommands,
},
{
Message: "Working with Ziti resources:",
Commands: []*cobra.Command{
Expand Down Expand Up @@ -197,6 +185,7 @@ func NewCmdRoot(in io.Reader, out, err io.Writer, cmd *cobra.Command) *cobra.Com
cmd.Version = version.GetVersion()
cmd.SetVersionTemplate("{{printf .Version}}\n")
cmd.AddCommand(NewCmdArt(out, err))
cmd.AddCommand(common.NewVersionCmd())

return cmd
}
Expand Down
2 changes: 1 addition & 1 deletion ziti/tunnel/version.go → ziti/cmd/common/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
limitations under the License.
*/

package tunnel
package common

import (
"fmt"
Expand Down
80 changes: 0 additions & 80 deletions ziti/cmd/fabric/add_identity.go

This file was deleted.

68 changes: 0 additions & 68 deletions ziti/cmd/fabric/remove_identity.go

This file was deleted.

1 change: 0 additions & 1 deletion ziti/cmd/fabric/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import (
func NewFabricCmd(p common.OptionsProvider) *cobra.Command {
fabricCmd := util.NewEmptyParentCmd("fabric", "Manage the Fabric components of a Ziti network using the Ziti Fabric REST and WebSocket APIs")

fabricCmd.AddCommand(newAddIdentityCmd(p), newRemoveIdentityCmd(p))
fabricCmd.AddCommand(newCreateCommand(p), newListCmd(p), newUpdateCommand(p), newDeleteCmd(p))
fabricCmd.AddCommand(newInspectCmd(p))
fabricCmd.AddCommand(newDbCmd(p))
Expand Down
Loading

0 comments on commit fdbc327

Please sign in to comment.