Skip to content

Instantly share code, notes, and snippets.

@Josh4324
Created November 24, 2020 09:47
Show Gist options
  • Save Josh4324/6aa0a58b8e2a0db6fc8ea4465c9c6fca to your computer and use it in GitHub Desktop.
Save Josh4324/6aa0a58b8e2a0db6fc8ea4465c9c6fca to your computer and use it in GitHub Desktop.
const yargs = require("yargs");
const utils = require("./utils");
yargs.command({
command: "add",
describe: "Add a new todo",
builder: {
title: {
describe: "Todo title",
type: "string",
demandOption: true,
},
todo: {
describe: "Todo Body",
type: "string",
demandOption: true,
},
},
handler: function (argv) {
utils.createTodo(argv.title, argv.todo)
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment