コード例 #1
0
ファイル: webpack.js プロジェクト: LoicMahieu/hackages
import cliparse from 'cliparse';
import build from '../webpackRunner';

const buildCMD = cliparse.command('build', {
  description: 'Build all your static assets using Webpack',
  options: [
    cliparse.flag('watch', {
      aliases: ['w'],
      description: 'Enable auto watch of js files',
    }),
  ],
},
build);

export default buildCMD;
コード例 #2
0
ファイル: philos.js プロジェクト: hackages/config.hacklunch
  console.log(message);
}

function addModule(params) {

}

const cliParser = cliparse.cli({
  name: "philos",
  description: "Philos CLI tools for managing projects",
  commands: [
    cliparse.command(
      "echo",
      { description: "Display the given value",
        args: [ cliparse.argument("value", { description: "Simple value" })],
        options: [ cliparse.flag("reverse", { aliases: ["r"], description: "Reverse the value"}) ]
      },
      echoModule),

    cliparse.command(
      "add2",
      { description: "Add 2 to the given integer and display the result",
        args: [
          cliparse.argument("int",
            { default: 0,
              parser: parsers.intParser,
              description: "Int to add 2 to" })
        ]
      },
      addModule)
  ]