mirror of
https://github.com/nushell/nushell
synced 2024-12-28 05:53:09 +00:00
Use enginep style in enter command (#3469)
This commit is contained in:
parent
21ef3895b3
commit
bcbdc33049
1 changed files with 4 additions and 7 deletions
|
@ -11,12 +11,6 @@ use std::path::PathBuf;
|
|||
|
||||
pub struct Enter;
|
||||
|
||||
#[derive(Deserialize)]
|
||||
pub struct EnterArgs {
|
||||
location: Tagged<PathBuf>,
|
||||
encoding: Option<Tagged<String>>,
|
||||
}
|
||||
|
||||
impl WholeStreamCommand for Enter {
|
||||
fn name(&self) -> &str {
|
||||
"enter"
|
||||
|
@ -80,7 +74,10 @@ fn enter(args: CommandArgs) -> Result<ActionStream, ShellError> {
|
|||
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<PathBuf> = args.req(0)?;
|
||||
let encoding: Option<Tagged<String>> = args.get_flag("encoding")?;
|
||||
let location_string = location.display().to_string();
|
||||
|
||||
if location.is_dir() {
|
||||
|
|
Loading…
Reference in a new issue