#!/usr/bin/env node "use strict"; const yargs = require("yargs"); const matchValue = require("match-value"); let argv = yargs .command("change", "Create a new schema revision") .command("upgrade ", "Upgrade the database to a new schema revision", { revision: { describe: "The number of the revision to upgrade to (or 'latest')" } }) .command("undo", "Undo the most recent schema revision upgrade") .command("show ", "Show the full database schema at a given revision") .argv; console.log(argv); matchValue(argv._[0], { change: () => { console.log("change"); }, upgrade: () => { console.log("upgrade"); }, undo: () => { console.log("undo"); }, show: () => { console.log("show"); } });