Skip to content

Conversation

@parro-it
Copy link

@parro-it parro-it commented Jun 2, 2017

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

jbrumwell and others added 28 commits September 23, 2016 17:17
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
Update babel/eslint build config
match: match,
matchArgs: matchArgs,
pipes: pipes
});
Copy link
Author

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.

Copy link
Author

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.

Copy link
Owner

@dthree dthree Jun 2, 2017

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.

});
vorpal
.command('overwrite me')
.command('overwrite_me')
Copy link
Author

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.

Copy link
Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants