Skip to content
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

Implement specification of subcommand #854

Closed
wants to merge 1 commit into from

Conversation

abetomo
Copy link
Collaborator

@abetomo abetomo commented Aug 30, 2018

Copy link
Collaborator

@shadowspawn shadowspawn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long comment. 🙂

I have not done run-time testing yet, this is some initial comments.

I would like to eventually add a routine to match .action where this configuration could go, but that is a bigger job, and I assume you don't want to wait for that, which is ok!

I like that you added the support in the existing .command options so does not affecting existing code.


Now for the requested change suggestion: I do not like subcommand as the option name.

We already have a lot of confusion over the two modes so we need a name to make it clearer that this is not relevant to .action based commands. I have been thinking about naming and considering words like "spawn" and "exec" and "external". I checked how people describe git subcommands and found "Git subcommands are standalone executables" which I thought was fairly clear.

Perhaps: "executableFile" instead of "subcommand"?

(I am not sure about "File" here, but came to that partly because node child_process has execFile. I will ask for comments on naming in the linked issue too.)

@shadowspawn
Copy link
Collaborator

To have behaviour consistent, I think we should calculate isExplicitJS when the option supplied name has an explicit suffix. (An easy way would be to call basename and fall through existing lookup code, but might be more appropriate to check the option supplied name directly.)

The behaviour I see is:

file        option      spawn
foo-bar                 spawn foo-bar
foo-bar.js              spawn node foo-bar.js
foo-bar.js  foo-bar     spawn node foo-bar.js (ok)
foo-bar.js  foo-bar.js  spawn foo-bar.js (surprise! did not detect file suffix)

@shadowspawn
Copy link
Collaborator

I don't think we need to wait any longer for feedback on executableFile, and I am still happy with that if ok with you.

@shadowspawn
Copy link
Collaborator

Would you like example code for the isExplicitJS feedback?

@shadowspawn
Copy link
Collaborator

This is being considered for v3, but some changes suggested. I am willing to help with code if wanted (in which case I'll get it reviewed before merging).

@shadowspawn
Copy link
Collaborator

Started work on implementing my suggestions

@shadowspawn
Copy link
Collaborator

Closing in favour of #999 which builds on this pull request.

@shadowspawn shadowspawn removed this from the v3.0.0 milestone Jul 20, 2019
@abetomo abetomo deleted the feature_specify_subcommand branch July 23, 2019 05:56
@shadowspawn
Copy link
Collaborator

Available now as a prerelease. See #1001

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.

None yet

2 participants