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

Document the process of parsing command-line arguments #40521

Merged
merged 1 commit into from
Jul 20, 2020
Merged

Document the process of parsing command-line arguments #40521

merged 1 commit into from
Jul 20, 2020

Conversation

Xrayez
Copy link
Contributor

@Xrayez Xrayez commented Jul 19, 2020

Parsing is not so trivial with current limitations, so worth documenting now than never, even if #26213 gets implemented.

The instructions are taken from a Q&A answer provided by @Calinou, so added as co-author. 🙂

@Xrayez Xrayez requested a review from a team as a code owner July 19, 2020 21:25
@Calinou
Copy link
Member

Calinou commented Jul 20, 2020

Since Godot 3.2, it should now be possible to parse command-line arguments without requiring a = between the key and value thanks to #33149. The parsing code should be modified to allow both --key value and --key=value forms (if that's not too complex) or just --key value.

@Calinou Calinou added cherrypick:3.x Considered for cherry-picking into a future 3.x release documentation enhancement labels Jul 20, 2020
@Calinou Calinou added this to the 4.0 milestone Jul 20, 2020
@Xrayez
Copy link
Contributor Author

Xrayez commented Jul 20, 2020

I guess it's time to replace/rewrite my existing parser then. 👀

I'll come back to this once I overhaul the parsing logic (or feel free to document this yourself).

This is what Gut does for command-line parsing.

@Xrayez Xrayez marked this pull request as draft July 20, 2020 08:31
@Calinou
Copy link
Member

Calinou commented Jul 20, 2020

@Xrayez To be fair, we could merge your PR as-is. A complete robust command-line parser can't be implemented in a few lines of code. It might be worth adding a note that this parser is a minimal implementation and may not suit all use cases.

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
@Xrayez
Copy link
Contributor Author

Xrayez commented Jul 20, 2020

Yeah I updated the PR to remove the obsolete information at least.

@Xrayez Xrayez marked this pull request as ready for review July 20, 2020 09:54
@akien-mga akien-mga merged commit fe1ec3b into godotengine:master Jul 20, 2020
@akien-mga
Copy link
Member

Thanks!

@Xrayez Xrayez deleted the doc-cmdline-parsing branch July 20, 2020 11:55
@akien-mga
Copy link
Member

Cherry-picked for 3.2.3.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants