Skip to content

Commit

Permalink
list-env CLI command (#6709)
Browse files Browse the repository at this point in the history
* cli for all Environment

* changelog

* Update cmd/osmosisd/cmd/change_environment.go

Co-authored-by: Matt, Park <[email protected]>

* lint

---------

Co-authored-by: Matt, Park <[email protected]>
  • Loading branch information
DongLieu and mattverse authored Oct 21, 2023
1 parent 6a28004 commit 8e252bc
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
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

0 comments on commit 8e252bc

Please sign in to comment.