mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 01:15:14 +02:00
Option to replace command same name (#374)
* option to replace command same name * moved order of custom value declarations * arranged dataframe folders and objects * sort help commands by name * added dtypes function for debugging * corrected name for dataframe commands * command names using function
This commit is contained in:
@ -15,7 +15,7 @@ impl Command for Debug {
|
||||
}
|
||||
|
||||
fn signature(&self) -> Signature {
|
||||
Signature::build("describe").category(Category::Core)
|
||||
Signature::build("debug").category(Category::Core)
|
||||
}
|
||||
|
||||
fn run(
|
||||
|
@ -187,7 +187,6 @@ fn help(
|
||||
.into_pipeline_data(engine_state.ctrlc.clone()))
|
||||
} else {
|
||||
let mut name = String::new();
|
||||
let mut output = String::new();
|
||||
|
||||
for r in &rest {
|
||||
if !name.is_empty() {
|
||||
@ -196,16 +195,15 @@ fn help(
|
||||
name.push_str(&r.item);
|
||||
}
|
||||
|
||||
for cmd in full_commands {
|
||||
if cmd.0.name == name {
|
||||
let help = get_full_help(&cmd.0, &cmd.1, engine_state);
|
||||
output.push_str(&help);
|
||||
}
|
||||
}
|
||||
let output = full_commands
|
||||
.iter()
|
||||
.filter(|(signature, _, _)| signature.name == name)
|
||||
.map(|(signature, examples, _)| get_full_help(signature, examples, engine_state))
|
||||
.collect::<Vec<String>>();
|
||||
|
||||
if !output.is_empty() {
|
||||
Ok(Value::String {
|
||||
val: output,
|
||||
val: output.join("======================\n\n"),
|
||||
span: call.head,
|
||||
}
|
||||
.into_pipeline_data())
|
||||
|
Reference in New Issue
Block a user