Skip to content

Commit

Permalink
feat(build): command help
Browse files Browse the repository at this point in the history
  • Loading branch information
cha0s committed Jan 24, 2024
1 parent e3a6d30 commit 42daad3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/build/build/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ program
action,
args = [],
description,
help,
name = keys[i],
options = [],
} = commands[keys[i]];
Expand All @@ -61,6 +62,9 @@ program
cmd.addOption(options[i]);
}
cmd.action(forwardProcessCode(action));
if (help) {
cmd.addHelpText('after', `\n${help}`);
}
}
// Parse commandline.
program.parse(process.argv);
Expand Down
7 changes: 7 additions & 0 deletions packages/dox/build/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ module.exports = (program, flecks) => {
.choices(['build', 'create', 'start']),
siteDirArgument,
],
help: [
'The `build` and `start` subcommands are sugar on top of the corresponding Docusaurus commands.',
'',
'The `create` subcommand will create a documentation website starter template for you at `siteDir`',
"if `siteDir` doesn't already exist (defaults to `website`). A `docusaurus.config.js`",
"starter configuration will also be copied to your `build` directory if it doesn't already exist.",
].join('\n'),
};
return commands;
};

0 comments on commit 42daad3

Please sign in to comment.