mirror of
https://github.com/nushell/nushell.git
synced 2025-07-07 10:01:26 +02:00
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:
@ -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)
|
||||
|
Reference in New Issue
Block a user