Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list-env CLI command #6709

Merged
merged 4 commits into from
Oct 21, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* [#6420](https://github.com/osmosis-labs/osmosis/pull/6420) feat[CL]: Creates a governance set whitelist of addresses that can bypass the normal pool creation restrictions on concentrated liquidity pools
* [#6623](https://github.com/osmosis-labs/osmosis/pull/6420) feat: transfer cl positions to new owner
* [#6632](https://github.com/osmosis-labs/osmosis/pull/6632) Taker fee bypass whitelist
* [#6709](https://github.com/osmosis-labs/osmosis/pull/6709) CLI: Add list-env, all Environment for CLI

### State Breaking

Expand Down
47 changes: 47 additions & 0 deletions cmd/osmosisd/cmd/change_environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,50 @@ func customArgs(cmd *cobra.Command, args []string) error {
}
return nil
}
func PrintAllEnvironmentCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "list-env ",
Short: "listing all available environments.",
Long: `listing all available environments.
Example:
osmosisd list-env'
Returns all EnvironmentCmd`,
RunE: func(cmd *cobra.Command, args []string) error {
// mainnet
path, err := environmentNameToPath(EnvMainnet)
if err != nil {
fmt.Printf("Error: %v \n", err)
}

fmt.Printf("Environment name, path: %s, %s\n", EnvMainnet, path)

// localnet
path, err = environmentNameToPath(EnvLocalnet)
if err != nil {
fmt.Printf("Error: %v \n", err)
}

fmt.Printf("Environment name, path: %s, %s\n", EnvLocalnet, path)

// testnet
path, err = environmentNameToPath(EnvTestnet)
if err != nil {
fmt.Printf("Error: %v \n", err)
}

fmt.Printf("Environment name, path: %s, %s\n", EnvTestnet, path)

// OSMOSISD_ENVIRONMENT
val := os.Getenv(EnvVariable)
path, err = environmentNameToPath(val)
if err != nil {
fmt.Printf("Error: %v \n", err)
}

fmt.Printf("Environment name, path: %s, %s\n", EnvVariable, path)

return nil
},
}
return cmd
}
1 change: 1 addition & 0 deletions cmd/osmosisd/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ func initRootCmd(rootCmd *cobra.Command, encodingConfig params.EncodingConfig) {
ConfigCmd(),
ChangeEnvironmentCmd(),
PrintEnvironmentCmd(),
PrintAllEnvironmentCmd(),
UpdateAssetListCmd(osmosis.DefaultNodeHome, osmosis.ModuleBasics),
)

Expand Down