Skip to content
Open
Changes from all 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
33 changes: 24 additions & 9 deletions clients/cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2342,7 +2342,17 @@ fn main() {
.validator(is_valid_signer)
.takes_value(true)
.global(true)
.help("Transaction fee payer account [default: cli config keypair]"),
.help("Transaction fee payer account [defaults: cli config keypair]"),
)
.arg(
Arg::with_name("keypair_path")
.long("keypair-path")
.short("k")
.value_name("PATH")
Comment on lines +2348 to +2351
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: let's update these to be consistent with the solana CLI

Suggested change
Arg::with_name("keypair_path")
.long("keypair-path")
.short("k")
.value_name("PATH")
Arg::with_name("keypair")
.long("keypair")
.short("k")
.value_name("KEYPAIR")

.validator(is_keypair_or_ask_keyword)
.takes_value(true)
.global(true)
.help("Default keypair path for all operations [default: cli config keypair]"),
)
.arg(compute_unit_price_arg().validator(is_parsable::<u64>).global(true))
.arg(
Expand Down Expand Up @@ -3146,14 +3156,19 @@ fn main() {
} else {
solana_cli_config::Config::default()
};

let default_keypair_path = matches
.value_of("keypair_path")
.unwrap_or(&cli_config.keypair_path);

let config = {
let json_rpc_url = value_t!(matches, "json_rpc_url", String)
.unwrap_or_else(|_| cli_config.json_rpc_url.clone());

let staker = get_signer(
&matches,
"staker",
&cli_config.keypair_path,
default_keypair_path,
&mut wallet_manager,
SignerFromPathConfig {
allow_null_signer: false,
Expand All @@ -3164,7 +3179,7 @@ fn main() {
Some(get_signer(
&matches,
"funding_authority",
&cli_config.keypair_path,
default_keypair_path,
&mut wallet_manager,
SignerFromPathConfig {
allow_null_signer: false,
Expand All @@ -3176,7 +3191,7 @@ fn main() {
let manager = get_signer(
&matches,
"manager",
&cli_config.keypair_path,
default_keypair_path,
&mut wallet_manager,
SignerFromPathConfig {
allow_null_signer: false,
Expand All @@ -3185,7 +3200,7 @@ fn main() {
let token_owner = get_signer(
&matches,
"token_owner",
&cli_config.keypair_path,
default_keypair_path,
&mut wallet_manager,
SignerFromPathConfig {
allow_null_signer: false,
Expand All @@ -3194,7 +3209,7 @@ fn main() {
let fee_payer = get_signer(
&matches,
"fee_payer",
&cli_config.keypair_path,
default_keypair_path,
&mut wallet_manager,
SignerFromPathConfig {
allow_null_signer: false,
Expand Down Expand Up @@ -3351,7 +3366,7 @@ fn main() {
let withdraw_authority = get_signer(
arg_matches,
"withdraw_authority",
&cli_config.keypair_path,
default_keypair_path,
&mut wallet_manager,
SignerFromPathConfig {
allow_null_signer: false,
Expand Down Expand Up @@ -3416,7 +3431,7 @@ fn main() {
let sol_receiver = get_signer(
arg_matches,
"sol_receiver",
&cli_config.keypair_path,
default_keypair_path,
&mut wallet_manager,
SignerFromPathConfig {
allow_null_signer: true,
Expand Down Expand Up @@ -3529,7 +3544,7 @@ fn main() {
let withdraw_authority = get_signer(
arg_matches,
"withdraw_authority",
&cli_config.keypair_path,
default_keypair_path,
&mut wallet_manager,
SignerFromPathConfig {
allow_null_signer: false,
Expand Down