add aliases for solana workflow generate-nonce-account

This commit is contained in:
Ryan Heywood 2025-02-26 19:08:07 -05:00
parent e12d655245
commit 719f695d3a
Signed by: ryan
GPG Key ID: 8E401478A3FBEF72
3 changed files with 21 additions and 24 deletions

View File

@ -51,7 +51,7 @@ impl Input {
}
pub fn is_required(&self) -> bool {
self.optional.is_some_and(|o| o)
self.optional.is_some_and(|o| !o)
}
}

View File

@ -95,25 +95,22 @@ pub fn generate_command(workflow: &Workflow) -> clap::Command {
// NOTE: all required inputs are still marked as .required(false) since they could be included
// in the `--input-file` argument.
for input in workflow.inputs.iter() {
for arg in input.identifiers() {
let arg = clap::Arg::new(arg)
.required(false)
.help(&input.description)
.long(arg.replace('_', "-"))
.value_name(arg.to_uppercase())
.conflicts_with_all(
input
.identifiers()
.filter(|name| *name != arg)
.collect::<Vec<_>>(),
);
command = command.arg(arg);
}
let name = &input.name;
let arg = clap::Arg::new(name)
.required(false)
.help(&input.description)
.long(name.replace('_', "-"))
.value_name(name.to_uppercase())
.visible_aliases(&input.aliases);
command = command.arg(arg);
}
command.arg(clap::arg!(
--"input-file" [FILE]
"A file containing any inputs not passed on the command line"
))
command.arg(
clap::arg!(
--"input-file" [FILE]
"A file containing any inputs not passed on the command line"
)
.value_parser(clap::value_parser!(std::path::PathBuf)),
)
}
fn load_inputs<'a>(
@ -127,11 +124,7 @@ fn load_inputs<'a>(
.and_then(|f| serde_json::from_reader(f).ok());
for input in inputs {
let identifier = &input.name;
match input
.identifiers()
.filter_map(|name| matches.get_one::<String>(name))
.next()
{
match matches.get_one::<String>(&input.name) {
Some(value) => {
map.insert(identifier.clone(), value.clone());
continue;

View File

@ -15,6 +15,10 @@ inputs:
workflows) is required to be a signer of the transaction, so the
authorization address is often the principal address - the one performing
the transaction.
aliases:
- primary_address
- principal_address
- pubkey
step:
- type: "sol-generate-wallet"
- type: "sol-get-wallet-address"