mirror of
https://github.com/nushell/nushell
synced 2025-01-03 16:58:58 +00:00
22 lines
422 B
Rust
22 lines
422 B
Rust
|
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;
|
||
|
}
|