forked from extern/nushell
nu-cli: directory syntax shape + completions (#5299)
This commit is contained in:
@ -17,7 +17,7 @@ impl Command for Cd {
|
||||
|
||||
fn signature(&self) -> nu_protocol::Signature {
|
||||
Signature::build("cd")
|
||||
.optional("path", SyntaxShape::Filepath, "the path to change to")
|
||||
.optional("path", SyntaxShape::Directory, "the path to change to")
|
||||
.category(Category::FileSystem)
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ impl Command for Mkdir {
|
||||
Signature::build("mkdir")
|
||||
.rest(
|
||||
"rest",
|
||||
SyntaxShape::Filepath,
|
||||
SyntaxShape::Directory,
|
||||
"the name(s) of the path(s) to create",
|
||||
)
|
||||
.switch("show-created-paths", "show the path(s) created.", Some('s'))
|
||||
|
@ -237,6 +237,7 @@ fn convert_to_value(
|
||||
expr.span,
|
||||
)),
|
||||
Expr::Filepath(val) => Ok(Value::String { val, span }),
|
||||
Expr::Directory(val) => Ok(Value::String { val, span }),
|
||||
Expr::Float(val) => Ok(Value::Float { val, span }),
|
||||
Expr::FullCellPath(full_cell_path) => {
|
||||
if !full_cell_path.tail.is_empty() {
|
||||
|
Reference in New Issue
Block a user