0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-31 09:14:20 -04:00
denoland-deno/cli/tests/testdata/npm/cjs_yargs/main.js

21 lines
464 B
JavaScript
Raw Normal View History

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);