budibase/packages/cli/src/index.js

19 lines
460 B
JavaScript
Raw Normal View History

2021-02-25 15:42:50 +01:00
const { getOptions, addHelp, displayHelp } = require("./options")
2021-02-24 18:32:45 +01:00
const { Command } = require("commander")
2021-02-25 15:42:50 +01:00
// add hosting config
function init() {
const program = new Command()
addHelp(program)
for (let option of getOptions()) {
option.configure(program)
}
program.parse(process.argv)
const userInput = program.opts()
for (let option of getOptions()) {
if (option.isItThisOption(userInput)) {
option.execute(userInput)
}
}
}