mirror of
https://github.com/nushell/nushell.git
synced 2025-06-30 22:50:14 +02:00
nu-command/filters: drop column check positive value (#6412)
This commit is contained in:
@ -49,6 +49,13 @@ impl Command for DropColumn {
|
||||
1
|
||||
};
|
||||
|
||||
// Make columns to drop is positive
|
||||
if columns_to_drop < 0 {
|
||||
if let Some(expr) = call.positional_nth(0) {
|
||||
return Err(ShellError::NeedsPositiveValue(expr.span));
|
||||
}
|
||||
}
|
||||
|
||||
dropcol(engine_state, span, input, columns_to_drop)
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user