arcanis / clipanion

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

Disallow registering the same command several times #105

Closed jonahsnider closed 2 months ago

jonahsnider commented 3 years ago
import {Builtins, Cli} from 'clipanion';

const cli = new Cli({
    binaryLabel: `cli`,
    binaryName: `cli`,
    binaryVersion: `1.0.0`,
});

cli.register(Builtins.VersionCommand);
cli.register(Builtins.VersionCommand);
cli.register(Builtins.VersionCommand);
cli.register(Builtins.VersionCommand);
cli.register(Builtins.VersionCommand);

This should not be possible.