mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 00:44:57 +02:00
Fix the for loop to create vars
This commit is contained in:
@ -36,6 +36,7 @@ pub struct Signature {
|
||||
pub rest_positional: Option<PositionalArg>,
|
||||
pub named: Vec<Flag>,
|
||||
pub is_filter: bool,
|
||||
pub creates_scope: bool,
|
||||
}
|
||||
|
||||
impl PartialEq for Signature {
|
||||
@ -62,6 +63,7 @@ impl Signature {
|
||||
rest_positional: None,
|
||||
named: vec![],
|
||||
is_filter: false,
|
||||
creates_scope: false,
|
||||
}
|
||||
}
|
||||
pub fn build(name: impl Into<String>) -> Signature {
|
||||
@ -189,6 +191,12 @@ impl Signature {
|
||||
self
|
||||
}
|
||||
|
||||
/// Sets that signature will create a scope as it parses
|
||||
pub fn creates_scope(mut self) -> Signature {
|
||||
self.creates_scope = true;
|
||||
self
|
||||
}
|
||||
|
||||
/// Get list of the short-hand flags
|
||||
pub fn get_shorts(&self) -> Vec<char> {
|
||||
self.named.iter().filter_map(|f| f.short).collect()
|
||||
|
Reference in New Issue
Block a user