You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: