mirror of
https://github.com/LukeHagar/sailpoint-cli.git
synced 2025-12-06 04:21:15 +00:00
Added environment help
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package environment
|
package environment
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
_ "embed"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/charmbracelet/log"
|
"github.com/charmbracelet/log"
|
||||||
@@ -11,7 +12,11 @@ import (
|
|||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
//go:embed environment.md
|
||||||
|
var environmentHelp string
|
||||||
|
|
||||||
func NewEnvironmentCommand() *cobra.Command {
|
func NewEnvironmentCommand() *cobra.Command {
|
||||||
|
help := util.ParseHelp(environmentHelp)
|
||||||
var env string
|
var env string
|
||||||
var overwrite bool
|
var overwrite bool
|
||||||
var erase bool
|
var erase bool
|
||||||
@@ -19,8 +24,8 @@ func NewEnvironmentCommand() *cobra.Command {
|
|||||||
cmd := &cobra.Command{
|
cmd := &cobra.Command{
|
||||||
Use: "environment",
|
Use: "environment",
|
||||||
Short: "Manage Environments for the CLI",
|
Short: "Manage Environments for the CLI",
|
||||||
Long: "\nManage Environments for the CLI\n\n",
|
Long: help.Long,
|
||||||
Example: "sail env dev",
|
Example: help.Example,
|
||||||
Aliases: []string{"env"},
|
Aliases: []string{"env"},
|
||||||
Args: cobra.MaximumNArgs(1),
|
Args: cobra.MaximumNArgs(1),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
@@ -65,7 +70,7 @@ func NewEnvironmentCommand() *cobra.Command {
|
|||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.Warn("No Environment Provided")
|
cmd.Help()
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
48
cmd/environment/environment.md
Normal file
48
cmd/environment/environment.md
Normal 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
|
||||||
|
```
|
||||||
|
====
|
||||||
Reference in New Issue
Block a user