-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCommands.js
62 lines (53 loc) · 1.89 KB
/
Commands.js
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
'use strict';
/** Local Modules **/
import { jsonify_xml, xmlify_json, markdownify_html, htmlify_markdown, yamlify_json, tomlify_json } from "./CommandFunctions.js";
/**
* Commands - Map
* @param {Object} Program - Instance of the commander program
* @description Maps the various commands to the glove-box program.
*/
const MapCommands = (Program) => {
Program
.command(`jsonify_xml`)
.description(`parse XML to JSON`)
.option(`--path [string]`, `path to the xml file to parse`)
.action(function(options) {
jsonify_xml(options)
});
Program
.command(`xmlify_json`)
.description(`parse JSON to an XML`)
.option(`--path [string]`, `path to the json file to build the xml from`)
.action(function(options) {
xmlify_json(options);
});
Program
.command(`yamlify_json`)
.description(`parse JSON to a YAML`)
.option(`--path [string]`, `path to the json file to build the xml from`)
.action(function(options) {
yamlify_json(options);
});
Program
.command(`tomlify_json`)
.description(`parse JSON to TOML`)
.option(`--path [string]`, `path to the json file to build the xml from`)
.action(function(options) {
tomlify_json(options);
});
Program
.command(`markdownify_html`)
.description(`parse Markdown to a HTML`)
.option(`--path [string]`, `path to the markdown file to build the html from`)
.action(function(options) {
markdownify_html(options);
});
Program
.command(`htmlify_markdown`)
.description(`parse HTML into Markdown`)
.option(`--path [string]`, `path to the markdown file to build the html from`)
.action(function(options) {
htmlify_markdown(options);
});
}
export { MapCommands };