#!/usr/bin/env node
const yargs  = require('yargs')

yargs.help('help')
  .completion()
  .option('username', {alias: 'u', desc: "Username", global: true, string: true})
  .option('password', {alias: 'p', desc: "Password", global: true, string: true})
  .option('host',     {alias: 'h', desc: "Server host (http://weblium.com)", global: true, string: true})
  .option("console", {
    default: "dir", desc: "dir|json|log|raw", string: true, global: true, choises: ["dir", "json", "log", "raw"]
  })

require("./lib/login").cli(yargs)
require("./lib/whoami")(yargs)
require("./lib/block")(yargs)
require("./lib/user")(yargs)
require("./lib/website")(yargs)
require("./lib/ref").cli(yargs)
require("./lib/blockCategory")(yargs)
require("./lib/uikit")(yargs)

yargs.wrap(yargs.terminalWidth())

if(yargs.argv.help || !yargs.argv._.length) {
  yargs.showHelp()
  process.exit(1)
}
