nushell/src/parser/registry.rs

22 lines
422 B
Rust
Raw Normal View History

2019-05-26 06:54:41 +00:00
use indexmap::IndexMap;
#[allow(unused)]
pub enum CommandType {
Switch,
Single,
Array,
}
#[allow(unused)]
pub struct CommandConfig {
crate name: String,
crate mandatory_positional: Vec<String>,
crate optional_positional: Vec<String>,
crate rest_positional: bool,
crate named: IndexMap<String, CommandType>,
}
pub trait CommandRegistry {
fn get(&self, name: &str) -> CommandConfig;
}