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

Clean up parsing. #80

Open
Stebalien opened this issue Mar 17, 2018 · 1 comment
Open

Clean up parsing. #80

Stebalien opened this issue Mar 17, 2018 · 1 comment

Comments

@Stebalien
Copy link
Member

Stebalien commented Mar 17, 2018

We should always construct requests with the NewRequest function and should handle everything like CheckArguments there. Currently, we end up calling CheckArguments multiple times and have to defend against this. Bleh.

@Stebalien
Copy link
Member Author

It's actually worse. I've fixed the double check here but we also check in cli's parseArgs function. However, we do so with completely different logic (and without blocking on stdin).

Really, we should do this in stages:

  1. Parse but don't check. Unfortunately, we still need access to the tree of commands to distinguish between arguments and subcommands.
  2. Handle help (before checking anything else).
  3. Check options and arguments.

This should also allow us to deduplicate some of this functionality.

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

1 participant