Skip to content

Commit

Permalink
v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
about-code committed Sep 15, 2019
1 parent 3c3e676 commit 6f7edca
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ console.log(
`)

// CLI
const cliOpts = buildOpts(
Object.assign(
{
"config": { type: "string", alias: "c", default: "" },
"help": { type: "boolean", alias: "h", default: false}
},
confSchema
)
const parameters = Object.assign(
{
"config": { type: "string", alias: "c", default: "" , description: "Path to config file, e.g. './glossarify-md.conf.json'."},
"help": { type: "boolean", alias: "h", default: false, description: "Show this help."}
},
confSchema
);
const cliOpts = buildOpts(parameters);
const args = minimist(proc.argv.slice(2), cliOpts);

if (args.help) {
console.log("Options:\n\n",
if (args.help || proc.argv.length === 2) {
console.log("Options:\n");
console.log(
Object
.keys(confSchema)
.keys(parameters)
.filter(key => key !== "dev")
.map(key => {
const {alias, type, description, default:_default} = confSchema[key];
return `--${alias} --${key} (${type})\n${description}\nDefault: ${JSON.stringify(_default)}\n\n`;
const {alias, type, description, default:_default} = parameters[key];
return `--${key}, --${alias} (${type})\n ${description}\n Default: ${JSON.stringify(_default)}\n\n`;
})
.join("")
);
Expand Down

0 comments on commit 6f7edca

Please sign in to comment.