| 1 | import { Command } from "commander"; |
| 2 | import { generateCompletionSpec } from "../../../src"; |
| 3 | |
| 4 | const program = new Command(); |
| 5 | |
| 6 | program |
| 7 | .version("0.1.0") |
| 8 | .argument("<username>", "user to login") |
| 9 | .argument("[password]", "password for user, if required", "no password given") |
| 10 | .description("example program for argument") |
| 11 | .command("generateCompletionSpec") |
| 12 | .description("Generate a fig spec for the current program") |
| 13 | .action(async () => { |
| 14 | console.log(await generateCompletionSpec(program)); |
| 15 | }); |
| 16 | program.command("remove", "Remove user"); // this should appear even if it is added after `generateCompletionSpec` command |
| 17 | |
| 18 | program.parse(); |