-
Notifications
You must be signed in to change notification settings - Fork 1
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
everything #1
base: main
Are you sure you want to change the base?
everything #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool design! I'd love to use this in my next CLI. A few thoughts:
index.js
Outdated
//. cut -s -d : -f 1 -- file1 file2 file3 = command | ||
//. -s -d : -f 1 -- file1 file2 file3 = arguments | ||
//. -s = flags = flag names | ||
//. -d : -f 1 = options | ||
//. -d -f = option names | ||
//. : 1 = option values | ||
//. -- = separator | ||
//. file1 file2 file3 = positional arguments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It took me a while to understand what's going on here. What am I looking at? What the significance of the cut
command in relation to terminology? How do I read the diagram being painted here?
I finally got that you're dissecting an invocation of the cut
command for the purposes of showing how you'd refer to each segment, with each line kind of being an entry in the dictionary but with the definition on the left.
Maybe a short explanation prior to this dictionary might help readers.
Perhaps more space before the =
sign might have also helped me parse it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated this section. Please have another look. :)
README.md
Outdated
- The argument is a (short/long) flag/option name. It is looked up in the | ||
specification. There are three possibilities: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no longer accurate now that we permit -xyz
. I will update this section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you updated that section?
@davidchambers really looking forward to ditching prompt and yargs for this! I should clarify, that I don't expect this to substitute prompt but hopefully it should be fairly easy to implement our own prompt based on sanctuary-argv. |
b49bea5
to
1696727
Compare
This pull request has been some time coming. I wrote the code two years ago and submitted davidchambers/transcribe#28, then decided that the code should live in its own package. This is that package. :)