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

Find script to run by partial text match #3

Closed
bahmutov opened this issue Nov 25, 2015 · 4 comments
Closed

Find script to run by partial text match #3

bahmutov opened this issue Nov 25, 2015 · 4 comments

Comments

@bahmutov
Copy link

I am tired of typing the entire command. What if nrun i could find the only script command that matches and runs "issues": "git-issues" for example?

@okv
Copy link
Contributor

okv commented Nov 26, 2015

Do you mean to dynamically find matched script by name?
If so, we do not do that because we think shell completion (nrun --completion >> ~/.bashrc) is good way to reach shorter commands.

@bahmutov
Copy link
Author

Not sure this is a good solution. Not cross platform, or even cross shell. Not tested, and the shell syntax is a minefield of the future.

@okv
Copy link
Contributor

okv commented Nov 27, 2015

Shell completion is not ideal (because of it's not cross platform nature in general) but worked for years =) It's pretty standard way for posix systems.
Imo, bad thing about dynamically partial commands matching is that it's not consistent over time and projects (e.g. nrun i may run one command today and another tomorrow (after changing package.json) or it will run different commands in different projects).
You can also use shell aliases or package.json for permanent short commands.

@bahmutov
Copy link
Author

I wrote my own https://github.com/bahmutov/npm-quick-run that does the completion in code, seems to work for my needs.

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

No branches or pull requests

2 participants