-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
53 lines (44 loc) · 1.32 KB
/
index.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
#!/usr/bin/env node
'use strict';
// Grandeur toolchain is designed to be
// make it easier for developers to get started
// with IoT dev. It is lose coupling on Arduino
// This toolchain is to Arduino, just the way
// Keras is to Tensorflow
// This file will be primarily used to define
// and link all the sub commands
// Import libraries
const commander = require("commander");
// Include sub commands
const init = require("./commands/init");
const run = require("./commands/run");
const monitor = require("./commands/monitor");
const install = require("./commands/install");
// Create a new program
const program = new commander.Command();
// Add init command to the program
program
.command("init")
.description("create a new sketch")
.option("-d, --debug")
.action(init);
// Add run command to the program
program
.command("run")
.description("compile and upload sketch")
.option("-d, --debug")
.action(run);
// Add monitor command to the program
program
.command("monitor")
.description("attach to serial of a board")
.option("-d, --debug")
.action(monitor);
// Add monitor command to the program
program
.command("install [module]")
.description("install dependencies or module")
.option("-d, --debug")
.action(install);
// Then run the handler
program.parse(process.argv);