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:
Fernando Herrera
2021-11-28 19:35:02 +00:00
committed by GitHub
parent e1e7e94261
commit c8b16c14d5
29 changed files with 490 additions and 220 deletions

View File

@ -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(

View File

@ -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())