summaryrefslogtreecommitdiff
path: root/tests/specs/npm/node_modules_dir_yargs/cjs_yargs/main.js
blob: 832fd053cd664645d5fe7a15b84a2c25066e3591 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import yargs from "npm:yargs@15.4.1";

const args = yargs(["serve", "8000"])
  .command("serve [port]", "start the server", (yargs) => {
    return yargs
      .positional("port", {
        describe: "port to bind on",
        default: 5000,
      });
  }, (argv) => {
    console.info(`start server on :${argv.port}`);
  })
  .option("verbose", {
    alias: "v",
    type: "boolean",
    description: "Run with verbose logging",
  })
  .argv;

console.log(args);