From 64efa30f3e7805ea1cca67943a86d28b11378490 Mon Sep 17 00:00:00 2001 From: Justin Ma Date: Mon, 6 Jun 2022 22:42:13 +0800 Subject: [PATCH] fix: normalize some parameter names (#5725) --- crates/nu-cli/src/print.rs | 4 ++-- crates/nu-command/src/database/commands/order_by.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/nu-cli/src/print.rs b/crates/nu-cli/src/print.rs index a478b7ad42..fff36de54b 100644 --- a/crates/nu-cli/src/print.rs +++ b/crates/nu-cli/src/print.rs @@ -17,7 +17,7 @@ impl Command for Print { Signature::build("print") .rest("rest", SyntaxShape::Any, "the values to print") .switch( - "no_newline", + "no-newline", "print without inserting a newline for the line ending", Some('n'), ) @@ -40,7 +40,7 @@ impl Command for Print { _input: PipelineData, ) -> Result { let args: Vec = call.rest(engine_state, stack, 0)?; - let no_newline = call.has_flag("no_newline"); + let no_newline = call.has_flag("no-newline"); let head = call.head; for arg in args { diff --git a/crates/nu-command/src/database/commands/order_by.rs b/crates/nu-command/src/database/commands/order_by.rs index 6d8a726ede..0afe69d062 100644 --- a/crates/nu-command/src/database/commands/order_by.rs +++ b/crates/nu-command/src/database/commands/order_by.rs @@ -24,7 +24,7 @@ impl Command for OrderByDb { fn signature(&self) -> Signature { Signature::build(self.name()) .switch("ascending", "Order by ascending values", Some('a')) - .switch("nulls_first", "Show nulls first in order", Some('n')) + .switch("nulls-first", "Show nulls first in order", Some('n')) .rest( "select", SyntaxShape::Any, @@ -40,10 +40,10 @@ impl Command for OrderByDb { fn examples(&self) -> Vec { vec![Example { description: "orders query by a column", - example: r#"db open db.mysql - | db from table_a - | db select a - | db order-by a + example: r#"db open db.mysql + | db from table_a + | db select a + | db order-by a | db describe"#, result: None, }] @@ -57,7 +57,7 @@ impl Command for OrderByDb { input: PipelineData, ) -> Result { let asc = call.has_flag("ascending"); - let nulls_first = call.has_flag("nulls_first"); + let nulls_first = call.has_flag("nulls-first"); let expressions: Vec = call.rest(engine_state, stack, 0)?; let expressions = Value::List { vals: expressions,