-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
30 lines (20 loc) · 710 Bytes
/
Copy pathindex.js
File metadata and controls
30 lines (20 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/env node
const cli = require('commander');
const newPost = require('./actions/new')
cli.description("A simple CLI for you to generate a docusaurus content file.");
cli.name("docusaurus-post-generator");
cli.usage("<command>");
cli.addHelpCommand(false);
cli.helpOption(false);
cli
.command("new")
.argument("<template>", "The template to use for the new post.")
.argument("<title>", "The title of the post.")
.option("-t, --type <type>" , "Declare the type of the post, either 'doc' of 'blog")
.description(
`Generate a new post from a template.
If no template is provided,
the default template will be used.`
)
.action(newPost);
cli.parse(process.argv);