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

Remove flag's aliases from the flags property #108

Merged
merged 10 commits into from
Feb 20, 2019
Merged

Remove flag's aliases from the flags property #108

merged 10 commits into from
Feb 20, 2019

Conversation

PicchiKevin
Copy link
Contributor

@PicchiKevin PicchiKevin commented Jan 10, 2019

Fixes #102, short-flags in the cli.flags are a bit messy

@PicchiKevin
Copy link
Contributor Author

This PR add cli.simpleFlags, the only difference with cli.flags is that it wont output flags aliases.

Example:

const cli = m({
	argv: ['-c', '-l'],
	flags: {
		coco: {
			alias: 'c'
		},
		loco: {
			alias: 'l'
		}
	}
});

console.log(cli.flags);
//=> { c: true, coco: true, l: true, loco: true }

console.log(cli.simpleFlags);
//=> { c: true, coco: true}

index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved
index.js Outdated Show resolved Hide resolved

return {
input,
flags,
unnormalizedFlags,
Copy link
Owner

Choose a reason for hiding this comment

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

I'm still not sold on this name. I think we should try to come up with something shorter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've got unsortedFlags, what do you thing about it 🤷‍♂️ ?

Copy link
Owner

Choose a reason for hiding this comment

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

Not really better. Let's just go with unnormalizedFlags for now.

index.js Outdated Show resolved Hide resolved
@sindresorhus
Copy link
Owner

This also needs docs updates.

@PicchiKevin
Copy link
Contributor Author

Made the changes requested but still can't choose a name.
I've got unsortedFlags 🤷‍♂️

Also updated in the doc, should I add more infos ?

@sindresorhus sindresorhus changed the title Remove flags aliases from flags output Remove flag's aliases from the flags property Feb 20, 2019
@sindresorhus sindresorhus merged commit f36715c into sindresorhus:master Feb 20, 2019
@sindresorhus
Copy link
Owner

This looks good now. Thank you :)

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.

2 participants