Skip to content

Commit

Permalink
Merge branch 'tomas/cli-flexible-global-args-pos' (#2545)
Browse files Browse the repository at this point in the history
* origin/tomas/cli-flexible-global-args-pos:
  changelog: add #2545
  cli: allow to use global args at any position (before or after subcmd)
  • Loading branch information
tzemanovic committed Feb 15, 2024
2 parents 1535ac4 + f89f894 commit 55c1d41
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- CLI: Allow to use global args (`--chain-id`, `--base-dir`, `--wasm-dir` and
`--pre-genesis`) before or after a sub-command.
([\#2545](https://github.com/anoma/namada/pull/2545))
7 changes: 4 additions & 3 deletions crates/apps/src/lib/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3216,8 +3216,8 @@ pub mod args {
/// Add global args definition. Should be added to every top-level
/// command.
pub fn def(app: App) -> App {
app.arg(CHAIN_ID_OPT.def().help("The chain ID."))
.arg(BASE_DIR.def().help(
app.arg(CHAIN_ID_OPT.def().global(true).help("The chain ID."))
.arg(BASE_DIR.def().global(true).help(
"The base directory is where the nodes, client and wallet \
configuration and state is stored. This value can also \
be set via `NAMADA_BASE_DIR` environment variable, but \
Expand All @@ -3227,7 +3227,7 @@ pub mod args {
Unix,`$HOME/Library/Application Support/Namada` on \
Mac,and `%AppData%\\Namada` on Windows.",
))
.arg(WASM_DIR.def().help(
.arg(WASM_DIR.def().global(true).help(
"Directory with built WASM validity predicates, \
transactions. This value can also be set via \
`NAMADA_WASM_DIR` environment variable, but the argument \
Expand All @@ -3236,6 +3236,7 @@ pub mod args {
.arg(
PRE_GENESIS
.def()
.global(true)
.help("Dispatch pre-genesis specific logic."),
)
}
Expand Down

0 comments on commit 55c1d41

Please sign in to comment.