Skip to content

Commit

Permalink
[cli] Fix help description (MystenLabs#16394)
Browse files Browse the repository at this point in the history
## Description 

This PR fixes the help description.

## Test Plan 

How did you test the new or updated feature?

---
If your changes are not user-facing and do not break anything, you can
skip the following section. Otherwise, please briefly describe what has
changed under the Release Notes section.

### Type of Change (Check all that apply)

- [ ] protocol change
- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes
  • Loading branch information
stefan-mysten authored Feb 26, 2024
1 parent e50f409 commit 29daa05
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions crates/sui/src/client_ptb/ptb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,14 +263,15 @@ pub fn ptb_description() -> clap::Command {
)
.long_help(
"Assign a value to a variable name to use later in the PTB. \
If only a name is supplied, the result of \
the last transaction is binded to that name. If a name and value are \
supplied, then the name is binded to that value. \
\n If only a name is supplied, the result of \
the last transaction is bound to that name.\
\n If a name and value are \
supplied, then the name is bound to that value. \
\n\nExamples: \
\n --assign MYVAR 100 \
\n --assign X [100,5000] \
\n --split-coins gas [1000, 5000, 75000] \
\n --assign new_coins # bind new_coins to the result of previous transaction"
\n --assign new_coins # bound new_coins to the result of previous transaction"
)
.value_names(["NAME", "VALUE"]))
.arg(arg!(
Expand Down Expand Up @@ -313,9 +314,9 @@ pub fn ptb_description() -> clap::Command {
.long_help(
"Make a move call to a function.\
\n\nExamples:\
\n --move-call 0x1::option::is_none <u64> none\
\n --move-call std::option::is_none <u64> none\
\n --assign a none\
\n --move-call 0x1::option::is_none <u64> a"
\n --move-call std::option::is_none <u64> a"
)
.value_names(["PACKAGE::MODULE::FUNCTION", "TYPE", "FUNCTION_ARGS"]))
.arg(arg!(
Expand All @@ -326,7 +327,7 @@ pub fn ptb_description() -> clap::Command {
"Split the coin into N coins as per the given array of amounts.\
\n\nExamples:\
\n --split-coins gas [1000, 5000, 75000]\
\n --assign new_coins # binds the result of split-coins command to variable new_coins\
\n --assign new_coins # bounds the result of split-coins command to variable new_coins\
\n --split-coins @coin_object_id [100]"
)
.value_names(["COIN", "[AMOUNT]"]))
Expand All @@ -339,13 +340,21 @@ pub fn ptb_description() -> clap::Command {
\n\nExamples:\
\n --transfer-objects @address [obj1, obj2, obj3]\
\n --split-coins gas [1000, 5000, 75000]\
\n --assign new_coins # bind new_coins to result of split-coins to use next\
\n --assign new_coins # bound new_coins to result of split-coins to use next\
\n --transfer-objects @to_address [new_coins.0, new_coins.1, new_coins.2]"
)
.value_names(["TO", "[OBJECTS]"]))
.arg(arg!(
--"publish" <MOVE_PACKAGE_PATH>
"Publish the move package. It takes as input the folder where the package exists."
"Publish the Move package. It takes as input the folder where the package exists."
).long_help(
"Publish the Move package. It takes as input the folder where the package exists.\
\n\nExample:\
\n --move-call sui::tx_context::sender\
\n --assign sender\
\n --publish \".\"\
\n --assign upgrade_cap\
\n --transfer-objects sender \"[upgrade_cap]\""
).value_hint(ValueHint::DirPath))
.arg(arg!(
--"upgrade" <MOVE_PACKAGE_PATH>
Expand All @@ -362,10 +371,10 @@ pub fn ptb_description() -> clap::Command {
))
.arg(arg!(
--"warn-shadows"
"Enable shadow warning when including other PTB files. Off by default."
"Enable shadow warning when the same variable name is declared multiple times. Off by default."
))
.arg(arg!(
--"json"
"Return command outputs in json format"
"Return command outputs in json format."
))
}

0 comments on commit 29daa05

Please sign in to comment.