-
Notifications
You must be signed in to change notification settings - Fork 280
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
Introducing bash-parser dependency #246
base: master
Are you sure you want to change the base?
Conversation
Conflicts: dist/command.js dist/option.js lib/command.js
Rename variable from Vantage to Vorpal
Updated dev deps and switched to Yarn
Updated Inquirer to v3 and other prod deps
Support default values for options
Remove dist folder
…ig for Babel and ESLint.
Update babel/eslint build config
Convert commands to ES2015
Update lib/history.js to ES2015
Converted UI to ES2015
command: command, | ||
match: match, | ||
matchArgs: matchArgs, | ||
pipes: pipes | ||
}); |
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.
If I had understood correctly (please confirm) command prop contains the raw command string, match contains the eventually found Command object; matchArgs is an array of matched arguments, and pipes is an array of subsequent command in a pipe.
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.
I think we can introduce the parser here. bash-parser
could substitute part of the actual function code to provide same results.
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.
Yes, you have it right. The entire command execution code including pipe implementation should probably be re-written if we are going to use bash-parser. It needs a re-think from the ground up.
@@ -46,7 +46,7 @@ describe('integration tests:', function () { | |||
cb(undefined, item); | |||
}); | |||
vorpal | |||
.command('overwrite me') | |||
.command('overwrite_me') |
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.
Introducing bash-parser
, this test fail, because when you .exec
'overwrite me', only overwrite
is parsed as command name. me
is parsed as argument.
Changing the command name to overwrite_me
make the test pass.
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.
But I notice there are many test failing because the same assumption, that 'overwrite me' (e.g.) could be a single command name. So I fear I'm misunderstanding some vorpal assumption here.
@dthree could you help me?
This is an investigatory PR to study the introduction of a POSIX compliant shell code parser using bash-parser.
There is a tween PR on
cash
repo