1.1.2 • Published 2 years ago

@shagos/easycli v1.1.2

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

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago