arcanis / clipanion

Type-safe CLI library / framework with no runtime dependencies
https://mael.dev/clipanion/
1.1k stars 61 forks source link

Implements `runExit` #118

Closed arcanis closed 2 years ago

arcanis commented 2 years ago

Clipanion is currently a little annoying to use with single-command scripts because of its boilerplate. The new runExit API lets you write small CLIs even more easily:

import {Command, runExit} from 'clipanion';

runExit(class extends Command {
  async execute() {
    // ...
  }
});
merceyz commented 2 years ago

Helpers like this should probably not be attached to the Cli class so they can be tree shaken when not in use.

arcanis commented 2 years ago

But it's nice for readability 😢