mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 10:45:41 +02:00
Remove shape-directed import pattern parsing (#7570)
This commit is contained in:
@ -18,6 +18,8 @@ pub struct Call {
|
||||
pub arguments: Vec<Argument>,
|
||||
pub redirect_stdout: bool,
|
||||
pub redirect_stderr: bool,
|
||||
/// this field is used by the parser to pass additional command-specific information
|
||||
pub parser_info: Vec<Expression>,
|
||||
}
|
||||
|
||||
impl Call {
|
||||
@ -28,6 +30,7 @@ impl Call {
|
||||
arguments: vec![],
|
||||
redirect_stdout: true,
|
||||
redirect_stderr: false,
|
||||
parser_info: vec![],
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,6 +70,10 @@ impl Call {
|
||||
self.arguments.push(Argument::Positional(positional));
|
||||
}
|
||||
|
||||
pub fn add_parser_info(&mut self, info: Expression) {
|
||||
self.parser_info.push(info);
|
||||
}
|
||||
|
||||
pub fn add_unknown(&mut self, unknown: Expression) {
|
||||
self.arguments.push(Argument::Unknown(unknown));
|
||||
}
|
||||
@ -99,6 +106,10 @@ impl Call {
|
||||
self.positional_iter().count()
|
||||
}
|
||||
|
||||
pub fn parser_info_nth(&self, i: usize) -> Option<&Expression> {
|
||||
self.parser_info.get(i)
|
||||
}
|
||||
|
||||
pub fn has_flag(&self, flag_name: &str) -> bool {
|
||||
for name in self.named_iter() {
|
||||
if flag_name == name.0.item {
|
||||
|
Reference in New Issue
Block a user