mirror of
https://github.com/nushell/nushell.git
synced 2025-04-29 15:44:28 +02:00
* Add search terms to command * Rename Signature desc to usage To be named uniformly with extra_usage * Throw in foldl search term for reduce * Add missing usage to post * Add search terms to signature * Try to add capnp Signature serialization
29 lines
911 B
Rust
29 lines
911 B
Rust
use nu_errors::ShellError;
|
|
use nu_plugin::Plugin;
|
|
use nu_protocol::{CallInfo, ReturnValue, Signature, SyntaxShape};
|
|
|
|
use crate::start::Start;
|
|
|
|
impl Plugin for Start {
|
|
fn config(&mut self) -> Result<Signature, ShellError> {
|
|
Ok(Signature::build("start")
|
|
.usage("Opens each file/directory/URL using the default application")
|
|
.rest(
|
|
"rest",
|
|
SyntaxShape::String,
|
|
"files/urls/directories to open",
|
|
)
|
|
.named(
|
|
"application",
|
|
SyntaxShape::String,
|
|
"Specifies the application used for opening the files/directories/urls",
|
|
Some('a'),
|
|
)
|
|
.filter())
|
|
}
|
|
fn begin_filter(&mut self, call_info: CallInfo) -> Result<Vec<ReturnValue>, ShellError> {
|
|
self.parse(call_info)?;
|
|
self.exec().map(|_| Vec::new())
|
|
}
|
|
}
|