Skip to content

Define composition of commands #3

Description

@countvajhula

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions