1.1.2 • Published 1 year ago

@shagos/easycli v1.1.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

EasyCLI

Usage

cli.ts

export class CLI extends EasyCLI {
  constructor(options: CLIOptions) {
    super(options);

    this.registerCommands(new Echo());
  }
}

echo.ts

export class Echo extends Command {
  constructor() {
    super("echo");
  }

  run(args: (CLIArgs | CLIFlag)[]) {
    console.log(args.map((x) => x.value.join(" ")));
  }
}

index.ts

let cli = new CLI({ flags: [{ name: "--someflag", consumesNextArg: true }] });

cli.handleInput();
1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago