mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
Add -c flag and others to cmdline args (#853)
* Add -c flag and others to cmdline args * finish a little bit of cleanup * Oops, forgot file
This commit is contained in:
@ -206,7 +206,10 @@ pub fn get_documentation(
|
||||
}
|
||||
|
||||
if let Some(rest_positional) = &sig.rest_positional {
|
||||
long_desc.push_str(&format!(" ...args: {}\n", rest_positional.desc));
|
||||
long_desc.push_str(&format!(
|
||||
" ...{}: {}\n",
|
||||
rest_positional.name, rest_positional.desc
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
@ -267,7 +270,7 @@ fn get_flags_section(signature: &Signature) -> String {
|
||||
if let Some(short) = flag.short {
|
||||
if flag.required {
|
||||
format!(
|
||||
" -{}{} (required parameter) {:?} {}\n",
|
||||
" -{}{} (required parameter) {:?}\n {}\n",
|
||||
short,
|
||||
if !flag.long.is_empty() {
|
||||
format!(", --{}", flag.long)
|
||||
@ -279,7 +282,7 @@ fn get_flags_section(signature: &Signature) -> String {
|
||||
)
|
||||
} else {
|
||||
format!(
|
||||
" -{}{} {:?} {}\n",
|
||||
" -{}{} <{:?}>\n {}\n",
|
||||
short,
|
||||
if !flag.long.is_empty() {
|
||||
format!(", --{}", flag.long)
|
||||
@ -292,16 +295,16 @@ fn get_flags_section(signature: &Signature) -> String {
|
||||
}
|
||||
} else if flag.required {
|
||||
format!(
|
||||
" --{} (required parameter) {:?} {}\n",
|
||||
" --{} (required parameter) <{:?}>\n {}\n",
|
||||
flag.long, arg, flag.desc
|
||||
)
|
||||
} else {
|
||||
format!(" --{} {:?} {}\n", flag.long, arg, flag.desc)
|
||||
format!(" --{} {:?}\n {}\n", flag.long, arg, flag.desc)
|
||||
}
|
||||
} else if let Some(short) = flag.short {
|
||||
if flag.required {
|
||||
format!(
|
||||
" -{}{} (required parameter) {}\n",
|
||||
" -{}{} (required parameter)\n {}\n",
|
||||
short,
|
||||
if !flag.long.is_empty() {
|
||||
format!(", --{}", flag.long)
|
||||
@ -312,7 +315,7 @@ fn get_flags_section(signature: &Signature) -> String {
|
||||
)
|
||||
} else {
|
||||
format!(
|
||||
" -{}{} {}\n",
|
||||
" -{}{}\n {}\n",
|
||||
short,
|
||||
if !flag.long.is_empty() {
|
||||
format!(", --{}", flag.long)
|
||||
@ -323,9 +326,12 @@ fn get_flags_section(signature: &Signature) -> String {
|
||||
)
|
||||
}
|
||||
} else if flag.required {
|
||||
format!(" --{} (required parameter) {}\n", flag.long, flag.desc)
|
||||
format!(
|
||||
" --{} (required parameter)\n {}\n",
|
||||
flag.long, flag.desc
|
||||
)
|
||||
} else {
|
||||
format!(" --{} {}\n", flag.long, flag.desc)
|
||||
format!(" --{}\n {}\n", flag.long, flag.desc)
|
||||
};
|
||||
long_desc.push_str(&msg);
|
||||
}
|
||||
|
@ -13,7 +13,7 @@ pub use flatten::{
|
||||
pub use lex::{lex, Token, TokenContents};
|
||||
pub use lite_parse::{lite_parse, LiteBlock};
|
||||
|
||||
pub use parser::{find_captures_in_expr, parse, trim_quotes, Import};
|
||||
pub use parser::{find_captures_in_expr, parse, parse_block, trim_quotes, Import};
|
||||
|
||||
#[cfg(feature = "plugin")]
|
||||
pub use parse_keywords::parse_register;
|
||||
|
Reference in New Issue
Block a user