some filesystem command signatures (#7464)

# Description

Signature for the following commands:

- `cd` 
- `cp` 
- `glob` 
- `ls` 
- `mkdir` 
- `mv` 
- `open`
- `rm`
- `save`
- `touch`

Related to https://github.com/nushell/nushell/issues/7320

Co-authored-by: sholderbach <sholderbach@users.noreply.github.com>
This commit is contained in:
raccmonteiro
2022-12-19 12:40:57 +00:00
committed by GitHub
parent dae1b9a996
commit 5f48452e3b
10 changed files with 29 additions and 10 deletions

View File

@ -3,7 +3,8 @@ use nu_engine::{eval_block, CallExt};
use nu_protocol::ast::Call;
use nu_protocol::engine::{Command, EngineState, Stack};
use nu_protocol::{
Category, Example, PipelineData, RawStream, ShellError, Signature, Spanned, SyntaxShape, Value,
Category, Example, PipelineData, RawStream, ShellError, Signature, Spanned, SyntaxShape, Type,
Value,
};
use std::io::BufReader;
@ -35,6 +36,7 @@ impl Command for Open {
fn signature(&self) -> nu_protocol::Signature {
Signature::build("open")
.input_output_types(vec![(Type::Nothing, Type::Any), (Type::String, Type::Any)])
.optional("filename", SyntaxShape::Filepath, "the filename to use")
.switch("raw", "open file as raw binary", Some('r'))
.category(Category::FileSystem)