-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
Autogenerate flag help when no helpMessage is given #80
Comments
Meow was initially just created to be a small helper lib for making tiny CLI's. It has now outgrown that, but it never had ambitions of being a Commander replacement. I wouldn't mind having this though. |
This comment has been minimized.
This comment has been minimized.
#82 was closed as I got no response. If anyone wants to work on this, you can probably continue where that PR left off. Make sure to address the feedback given there. |
I've created a new PR #140! |
I'd love this as well. If not possible to completely auto-generate, maybe consider the option to have a const cli = meow({
description: 'A tool that does stuff with files and encodings',
inputs: ['<file>', '<encoding>'], // command name is auto-prepended based on process.argv
options: { // alternatively add the flag description to the flags object and make this property a boolean switch
'-c': 'Convert file encoding', // long option name auto-added based on flags object
'--dry-run': 'Output commands instead of executing', // option alias auto-added if available
'--help': 'Show this help message',
},
examples: {
'input.txt utf-8': 'Loads this file and converts to UTF-8', // command name is auto-prepended based on process.argv
'—dry-run other_file.csv': 'Outputs the file to stdout',
}
},
{
importMeta: import.meta,
flags: { … }
}) |
I'm coming from
commander
, which autogenerates documentation on flags, and was surprised to see thatmeow
'sautoHelp
feature doesn't do the same.should generate output something like
The text was updated successfully, but these errors were encountered: