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

add name() function, to explictly set the name #32

Merged
merged 2 commits into from
Oct 1, 2016

Conversation

TooTallNate
Copy link
Collaborator

For --help/-h only at the moment.

So that you can do something like this, when the
CLI name doesn't match the entry point file name:

import args from 'args';
import { name } from './package.json';

args.name(name);

For `--help`/`-h` only at the moment.

So that you can do something like this, when the
CLI name doesn't match the entry point file name:

``` js
import args from 'args';
import { name } from './package.json';

args.name(name);

…
```
@TooTallNate
Copy link
Collaborator Author

TooTallNate commented Sep 30, 2016

Meh. I guess I can use usageFilter for this…

@leo
Copy link
Owner

leo commented Sep 30, 2016

@TooTallNate What do you think? Should we still add .name() in addition? If so, please fix the tests (just some linting errors).

@TooTallNate
Copy link
Collaborator Author

Actually... instead of introducing a new function, we can do it in the .parse(argv, options) options object. So something like:

args.parse(process.argv, { name: 'foo' });

Thoughts?

So there's no new API functions.
Leverage the existing "options" configuration instead.
@TooTallNate
Copy link
Collaborator Author

3 LOC change at this point 💃

Probably squash when ready to merge.

@leo leo merged commit f838e16 into leo:master Oct 1, 2016
@leo
Copy link
Owner

leo commented Oct 1, 2016

Great way to handle it! Thx 😊

@leo
Copy link
Owner

leo commented Oct 1, 2016

Oh... And we also need to add it to the config list in the readme.

@TooTallNate TooTallNate deleted the add/name branch October 1, 2016 07:24
@leo
Copy link
Owner

leo commented Oct 3, 2016

@TooTallNate Released in 2.1.0! 🚀

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