Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
fix usage string and some errors
Browse files Browse the repository at this point in the history
  • Loading branch information
noise64 committed Dec 5, 2024
1 parent b797ade commit 0f5847b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion wasm-rpc-stubgen/src/commands/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,7 @@ fn collect_sources(mode: &ApplicationSourceMode) -> ValidatedResult<Vec<PathBuf>
})
}
}
None => ValidatedResult::from_error("No config file found!".to_string()),
None => ValidatedResult::from_error("No application manifest found!".to_string()),
},
ApplicationSourceMode::Explicit(sources) => {
let non_unique_source_warns: Vec<_> = sources
Expand Down
2 changes: 1 addition & 1 deletion wasm-rpc-stubgen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ pub fn initialize_workspace(
}

pub async fn run_app_command<CPE: ComponentPropertiesExtensions>(
clap_command: &mut clap::Command,
mut clap_command: clap::Command,
command: App,
) -> anyhow::Result<()> {
let (mut config, subcommand) = app_command_to_config_and_subcommand::<CPE>(command);
Expand Down
15 changes: 14 additions & 1 deletion wasm-rpc-stubgen/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,20 @@ async fn main() -> ExitCode {
#[cfg(feature = "app-command")]
Command::App { command } => {
run_app_command::<ComponentPropertiesExtensionsNone>(
clap_command.find_subcommand_mut("app").unwrap(),
{
// TODO: it would be nice to use the same logic which is used by default for handling help,
// and that way include the current context (bin name and parent commands),
// but that seems to be using errors, error formating and exit directly;
// and quite different code path compared to calling print_help
clap_command
.find_subcommand_mut("app")
.unwrap()
.clone()
.override_usage(format!(
"{} [OPTIONS] [COMMAND]",
"wasm-rpc-stubgen app".bold()
))
},
command,
)
.await
Expand Down

0 comments on commit 0f5847b

Please sign in to comment.