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

Define composition of commands #3

Open
countvajhula opened this issue Jul 3, 2021 · 0 comments
Open

Define composition of commands #3

countvajhula opened this issue Jul 3, 2021 · 0 comments

Comments

@countvajhula
Copy link
Owner

Defining commands in #lang cli has similar syntax to defining functions in Racket, and in fact, commands compile down to Racket functions.

Since commands are just functions, it should be relatively straightforward to define some form of composition on them. For instance, we may want to define a host of commands for various administrative tasks that we run individually, but which we'd also like to be able to compose so that, in order to run some combination of them, we needn't define an entirely new command from scratch, duplicating all of the flag specification and other boilerplate already encapsulated in the constituent commands.

To accomplish this, we'd need to define a notion, or several notions, of "command composition," which allows us to compose commands and have them share or divide up parameters supplied on the command line, and so that help text and other metadata also compose naturally in the resulting command.

For inspiration: the Click library for python supports composable commands.

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