From 249afc5df4abd562be6de516fdb53e9b553dcf76 Mon Sep 17 00:00:00 2001 From: Reilly Wood <26268125+rgwood@users.noreply.github.com> Date: Tue, 3 Jan 2023 15:49:43 -0800 Subject: [PATCH] Clarify `url` base command (#7670) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I noticed that the help for the `url` command was confusing (it wasn't clear that `url` is just a base command that does nothing itself) and the input type was also wrong. Fixed. Before: ```bash 〉help url Apply url function. Search terms: network, parse Usage: > url Subcommands: url parse - Parses a url Flags: -h, --help - Display the help message for this command Signatures: | url -> ``` After: ```bash 〉help url Various commands for working with URLs You must use one of the following subcommands. Using this command as-is will only produce this help message. Search terms: network, parse Usage: > url Subcommands: url parse - Parses a url Flags: -h, --help - Display the help message for this command Signatures: | url -> ``` --- crates/nu-command/src/network/url/url_.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/nu-command/src/network/url/url_.rs b/crates/nu-command/src/network/url/url_.rs index 6b572fc744..9b14177fb2 100644 --- a/crates/nu-command/src/network/url/url_.rs +++ b/crates/nu-command/src/network/url/url_.rs @@ -15,12 +15,16 @@ impl Command for Url { fn signature(&self) -> Signature { Signature::build("url") - .input_output_types(vec![(Type::String, Type::String)]) + .input_output_types(vec![(Type::Nothing, Type::String)]) .category(Category::Network) } fn usage(&self) -> &str { - "Apply url function." + "Various commands for working with URLs" + } + + fn extra_usage(&self) -> &str { + "You must use one of the following subcommands. Using this command as-is will only produce this help message." } fn search_terms(&self) -> Vec<&str> {