-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvel.ts
More file actions
44 lines (36 loc) · 1.12 KB
/
vel.ts
File metadata and controls
44 lines (36 loc) · 1.12 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// ----------------------------------------------------------------
// Purpouse:
// This script is responsible for parsing the CLI arguments
// and calling other classes and functions.
//
// Reference:
// - http://pdfkit.org/docs/getting_started.html
// ----------------------------------------------------------------
const { ArgumentParser } = require('argparse')
import { Command } from './src/Command'
const parser = new ArgumentParser({
description: 'Book rendering with Node & Typescript'
})
// Each command renders a single book.
parser.add_argument('-t', '--title', {
help: 'Book title such as "crypto".',
required: true,
})
// Each book shall support multiple languages.
parser.add_argument('-l', '--language', {
help: 'Language such as "en" or "es".',
default: 'en',
required: true,
})
// Each book shall support multiple formats.
parser.add_argument('-f', '--format', {
help: 'Format such as "pdf", "html" or "course".',
default: 'pdf',
required: true,
})
let args: any = parser.parse_args()
Command.run({
title: args.title,
language: args.language,
format: args.format,
})