1.1.2 • Published 3 years ago

@shagos/easycli v1.1.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years 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

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago