diff --git a/crates/nu-command/src/commands/enter.rs b/crates/nu-command/src/commands/enter.rs index 1b173bf690..ba827cfed5 100644 --- a/crates/nu-command/src/commands/enter.rs +++ b/crates/nu-command/src/commands/enter.rs @@ -11,12 +11,6 @@ use std::path::PathBuf; pub struct Enter; -#[derive(Deserialize)] -pub struct EnterArgs { - location: Tagged, - encoding: Option>, -} - impl WholeStreamCommand for Enter { fn name(&self) -> &str { "enter" @@ -80,7 +74,10 @@ fn enter(args: CommandArgs) -> Result { let context = args.context.clone(); let scope = args.scope().clone(); let path = args.context.shell_manager.path(); - let (EnterArgs { location, encoding }, _) = args.process()?; + let args = args.evaluate_once()?; + + let location: Tagged = args.req(0)?; + let encoding: Option> = args.get_flag("encoding")?; let location_string = location.display().to_string(); if location.is_dir() {