Added environment help

This commit is contained in:
luke-hagar-sp
2023-08-18 09:22:04 -05:00
parent c9fbb06551
commit b2a74a2d86
2 changed files with 56 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
package environment
import (
_ "embed"
"fmt"
"github.com/charmbracelet/log"
@@ -11,7 +12,11 @@ import (
"github.com/spf13/viper"
)
//go:embed environment.md
var environmentHelp string
func NewEnvironmentCommand() *cobra.Command {
help := util.ParseHelp(environmentHelp)
var env string
var overwrite bool
var erase bool
@@ -19,8 +24,8 @@ func NewEnvironmentCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "environment",
Short: "Manage Environments for the CLI",
Long: "\nManage Environments for the CLI\n\n",
Example: "sail env dev",
Long: help.Long,
Example: help.Example,
Aliases: []string{"env"},
Args: cobra.MaximumNArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
@@ -65,7 +70,7 @@ func NewEnvironmentCommand() *cobra.Command {
}
} else {
log.Warn("No Environment Provided")
cmd.Help()
}
return nil

View File

@@ -0,0 +1,48 @@
==Long==
# Environment
Configure SailPoint IdentityNow environments for the CLI
====
==Example==
## Adding an new environment
You can add new environments by supplying a name that does not already exist. The CLI will prompt you for the Tenant URL and API URL.
```bash
sail environment {environment-name}
```
## Switching environments
You can switch between environments by supplying the name of an existing environment you want to switch to.
```bash
sail environment {environment-name}
```
## Removing an environment
You can remove an environment by supplying the name of an existing environment you want to remove in combination with the `--erase` flag.
```bash
sail environment {environment-name} --erase
```
## Overwriting an environment
You can overwrite an environment by supplying the name of an existing environment you want to overwrite in combination with the `--overwrite` flag.
```bash
sail environment {environment-name} --overwrite
```
## Showing an environment
You can print an environment by supplying the name of an existing environment you want to print in combination with the `--show` flag.
```bash
sail environment {environment-name} --show
```
====