-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Builtin Outputs #249
Builtin Outputs #249
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, definitely needs more user friendly and less error prone way of outputting though
Now this PR is aiming to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. maybe some further thought can be put in on a unified output system in the future but this can do for now
@@ -35,8 +36,8 @@ impl BuiltinCmd for CdBuiltin { | |||
if let Ok(old_pwd) = rt.env.get("OLDPWD") { | |||
PathBuf::from(old_pwd) | |||
} else { | |||
eprintln!("no OLDPWD"); | |||
return Ok(BuiltinStatus::error()); | |||
ctx.out.eprintln("no OLDPWD")?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this still have the ability to format strings? is it still a variadic function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will make it variadic, good idea
This PR is aiming to solve #246 by making builtin commands return
CmdOutput
.The output of each builtin is captured into a CmdOutput and can be sent to hooks.