-
Notifications
You must be signed in to change notification settings - Fork 255
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
Consolidate Tools into a single Binary #274
Consolidate Tools into a single Binary #274
Conversation
6fcf4ab
to
80fbcaf
Compare
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.
This is a fantastic simplification and cleanup. I find it way easier to follow this way. None of the things I noticed here require changing, so I'm giving this a 👍.
@@ -100,6 +100,10 @@ pub fn execute_tool(session: &mut Session) -> Fallible<ExitStatus> { | |||
let mut args = args_os(); | |||
let exe = get_tool_name(&mut args)?; | |||
|
|||
// There is some duplication in the calls to `.exec` here. |
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.
The explanatory comment you added here is great!
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.
This is a nice improvement! Love when the "-" count exceeds the "+" count :D
Info
node
,npm
,npx
,yarn
), as well as forlaunchbin
andlaunchscript
.Changes
Tool
trait and implementations to support receiving the command-line arguments as inputs, instead of getting them internally.Tool::exec
to return a result, instead of exiting.execute_tool
function that parses the command-line arguments to determine which tool should be executed, then passes control over to that tool.shim
binary.shim
binary namednode
,npm
,npx
, andyarn
.shim
instead oflaunchbin
.if err.is_user_friendly()
blocks.Notes