diff --git a/crates/nu-command/src/env/config/config_reset.rs b/crates/nu-command/src/env/config/config_reset.rs index b951ce8c16..b901ce1604 100644 --- a/crates/nu-command/src/env/config/config_reset.rs +++ b/crates/nu-command/src/env/config/config_reset.rs @@ -2,7 +2,7 @@ use chrono::Local; use nu_protocol::{ ast::Call, engine::{Command, EngineState, Stack}, - Category, Example, PipelineData, ShellError, Signature, + Category, Example, PipelineData, ShellError, Signature, Type, }; use nu_utils::{get_default_config, get_default_env}; use std::io::Write; @@ -20,6 +20,8 @@ impl Command for ConfigReset { .switch("nu", "reset only nu config, config.nu", Some('n')) .switch("env", "reset only env config, env.nu", Some('e')) .switch("without-backup", "do not make a backup", Some('w')) + .input_output_types(vec![(Type::Nothing, Type::Nothing)]) + .allow_variants_without_examples(true) .category(Category::Env) } diff --git a/crates/nu-command/src/filesystem/cd.rs b/crates/nu-command/src/filesystem/cd.rs index 389b827756..e96b281131 100644 --- a/crates/nu-command/src/filesystem/cd.rs +++ b/crates/nu-command/src/filesystem/cd.rs @@ -4,7 +4,7 @@ use nu_engine::{current_dir, CallExt}; use nu_protocol::ast::Call; use nu_protocol::engine::{Command, EngineState, Stack}; use nu_protocol::{ - Category, Example, PipelineData, ShellError, Signature, Spanned, SyntaxShape, Value, + Category, Example, PipelineData, ShellError, Signature, Spanned, SyntaxShape, Type, Value, }; use std::path::Path; @@ -49,6 +49,11 @@ impl Command for Cd { fn signature(&self) -> nu_protocol::Signature { Signature::build("cd") .optional("path", SyntaxShape::Directory, "the path to change to") + .input_output_types(vec![ + (Type::Nothing, Type::Nothing), + (Type::String, Type::Nothing), + ]) + .allow_variants_without_examples(true) .category(Category::FileSystem) } diff --git a/crates/nu-command/src/system/benchmark.rs b/crates/nu-command/src/system/benchmark.rs index 0439e9a676..a7e6e9efab 100644 --- a/crates/nu-command/src/system/benchmark.rs +++ b/crates/nu-command/src/system/benchmark.rs @@ -4,7 +4,7 @@ use nu_engine::{eval_block, CallExt}; use nu_protocol::ast::Call; use nu_protocol::engine::{Closure, Command, EngineState, Stack}; use nu_protocol::{ - Category, Example, IntoPipelineData, PipelineData, Signature, SyntaxShape, Value, + Category, Example, IntoPipelineData, PipelineData, Signature, SyntaxShape, Type, Value, }; #[derive(Clone)] @@ -22,6 +22,8 @@ impl Command for Benchmark { fn signature(&self) -> nu_protocol::Signature { Signature::build("benchmark") .required("block", SyntaxShape::Block, "the block to run") + .input_output_types(vec![(Type::Block, Type::String)]) + .allow_variants_without_examples(true) .category(Category::System) } diff --git a/crates/nu-command/tests/format_conversions/html.rs b/crates/nu-command/tests/format_conversions/html.rs index 1a5824620f..1fdf41bbdc 100644 --- a/crates/nu-command/tests/format_conversions/html.rs +++ b/crates/nu-command/tests/format_conversions/html.rs @@ -72,7 +72,7 @@ fn test_no_color_flag() { ); assert_eq!( actual.out, - r"Change directory.

Usage:
> cd (path)

Flags:
-h, --help - Display the help message for this command

Parameters:
(optional) path <directory>: the path to change to

Examples:
Change to your home directory
> cd ~

Change to a directory via abbreviations
> cd d/s/9

Change to the previous working directory ($OLDPWD)
> cd -

" + r"Change directory.

Usage:
> cd (path)

Flags:
-h, --help - Display the help message for this command

Signatures:
<nothing> | cd <string?> -> <nothing>
<string> | cd <string?> -> <nothing>

Parameters:
(optional) path <directory>: the path to change to

Examples:
Change to your home directory
> cd ~

Change to a directory via abbreviations
> cd d/s/9

Change to the previous working directory ($OLDPWD)
> cd -

" ); }