const standardEntity = require("../standardEntity");
const hapi           = require("../hapi");

module.exports = yargs => yargs.command({
  command: "blockCategory",
  desc: "BlockCategory support",
  builder: yargs => standardEntity("blockCategory", {add: null, update: null })(yargs).command({
    command: "initial",
    desc: "Initialize Categories these can not be removed",
    handler: hapi(api => api.blockCategory.listInitial())
  }).command({
    command: "save <id> <name>",
    desc: "Save category with id and name",
    handler: hapi((api, {id, name}) => api.blockCategory.save({id, data: {name}})),
  }),
  handler() {yargs.showHelp()}
})
