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

Swap over script @main and Ammonite main argument parsing over to https://github.com/lihaoyi/mainargs #1126

Merged
merged 10 commits into from
Nov 22, 2020

Conversation

lihaoyi
Copy link
Member

@lihaoyi lihaoyi commented Nov 22, 2020

This brings with it slight incompatibilities that arise from the cleaned up API, but lets us delete large swathes of boilerplate code that are copy-pasted between this and other repositories I maintain

@lihaoyi lihaoyi merged commit 0833981 into master Nov 22, 2020
lihaoyi added a commit to com-lihaoyi/mill that referenced this pull request Nov 24, 2020
…inargs (#1008)

This replaces the copy-paste logic handling both Mill's own CLI argument parsing as well as the CLI argument parsing of user-defined `T.command`s to instead rely on the https://github.com/lihaoyi/mainargs implementation. This is similar to the earlier PR that performed such a migration in the lihaoyi/Ammonite repo com-lihaoyi/Ammonite#1126

Where the semantics of Mill's own CLI parsing and `T.command` CLI parsing differ, we pass in the corresponding flags to handle the difference, e.g. `allowPositional = false` for Mill's own parameters and `allowPositional = false` for `T.command`s.

Since the MainArgs library is standalone, we also cut the dependency on Scopt since it is now unnecessary. Our existing `scopt.Reads` are all replaced by `mainargs.TokensReader`

Things compile, haven't tested
@lefou lefou deleted the mainargs branch January 13, 2022 07:29
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.

1 participant