mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 15:11:52 +02:00
Evaluation of command arguments (#1801)
* WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * WIP * Finish adding the baseline refactors for argument invocation * Finish cleanup and add test * Add missing plugin references
This commit is contained in:
@ -39,15 +39,14 @@ impl WholeStreamCommand for Shuffle {
|
||||
args: CommandArgs,
|
||||
registry: &CommandRegistry,
|
||||
) -> Result<OutputStream, ShellError> {
|
||||
args.process(registry, shuffle)?.run()
|
||||
shuffle(args, registry)
|
||||
}
|
||||
}
|
||||
|
||||
fn shuffle(
|
||||
Arguments { limit }: Arguments,
|
||||
RunnableContext { input, .. }: RunnableContext,
|
||||
) -> Result<OutputStream, ShellError> {
|
||||
fn shuffle(args: CommandArgs, registry: &CommandRegistry) -> Result<OutputStream, ShellError> {
|
||||
let registry = registry.clone();
|
||||
let stream = async_stream! {
|
||||
let (Arguments { limit }, mut input) = args.process(®istry).await?;
|
||||
let mut values: Vec<Value> = input.collect().await;
|
||||
|
||||
let out = if let Some(n) = limit {
|
||||
|
Reference in New Issue
Block a user