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

Decouple Execution from Parsing #53

Open
BenjaminHolland opened this issue Feb 7, 2021 · 2 comments
Open

Decouple Execution from Parsing #53

BenjaminHolland opened this issue Feb 7, 2021 · 2 comments

Comments

@BenjaminHolland
Copy link

This library shouldn't tightly couple argument parsing and command execution. This is a mistake every cli library seems to make, at the expense of making the library generally useful. Parsing command-like strings into arbitrary types should arguably be explicitly the focus, with an optional layer for "automatic" executions of commands. In particular, use cases that involve REPL's, like bots, suffer from this coupling.

The results of parse should be either an instance of the filled out subcommand data or an error state. In addition. usage information should be publicly queryable to support custom usage displays (i.e. a version of makeUsage that returns an html snippet)

#48

penn5 added a commit to penn5/kotlinx-cli that referenced this issue May 9, 2021
Will help with Kotlin#53 and is overall a Good Thing (TM)
@anti-social
Copy link

Have the same thoughts: #45 (comment)

@beretis
Copy link

beretis commented Aug 25, 2022

This would be really great. Im working on an app, which has CLI api, but it has run loop, and I don't wanna terminate the process ever. I tried to subclass ArgParser, but the fact that internal var outputAndTerminate is internal means, that I cant even bend it my way :/
Now I have to implement parsing arguments on my own.

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

3 participants