-
Notifications
You must be signed in to change notification settings - Fork 1
/
args.js
49 lines (45 loc) · 1.29 KB
/
args.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
const settingsGcode = require('./settingsGcode').getSettings()
const yargs = require('yargs')
const args = yargs
.usage(`Usage: node main.js -f myFile.svg\nInput Folder: ${settingsGcode.inputFolder}\nOutput Folder: ${settingsGcode.exportFolder}`)
.option('file', {
alias: 'f',
description: 'give me a svg file to convert (required)',
type: 'string',
})
.option('travelSpeed', {
alias: 't',
description: 'travel speed (no printing)',
type: 'number',
default: 7000
})
.option('printingSpeed', {
alias: 'p',
description: 'speed during printing',
type: 'number',
default: 3200
})
.option('output', {
alias: 'o',
description: 'where to output the converted .gcode file ?',
type: 'string',
default: 'output.gcode'
})
.option('zOffset', {
alias: 'z',
description: 'elevation of the pen when moving (note: during printing Z=0 always)',
type: 'number',
default: 2
})
.option('useSvgo', {
alias: 's',
description: 'use svgo lib to make optimizations, can break some things',
type: 'boolean',
})
.demandOption(['f'])
.help()
.alias('help', 'h')
.argv
module.exports = {
args: args
}