commandr icon indicating copy to clipboard operation
commandr copied to clipboard

Feature request: method to handle command exection

Open zefir-git opened this issue 5 months ago • 0 comments

It would be nice if you could define a command handler directly on the Command instance, removing the need to use ProgramArgs and specify handling for everything there. That would allow sub-commands to be in their own modules and have their execution logic locally, rather than having everything in a single file.

For example:

new Command("foo", "bar")
    /* … */
    .action((arguments, options) => {
        /* … */
    });

Or subcommands could even be used as their own classes that extend Command.

zefir-git avatar Sep 02 '25 17:09 zefir-git