forked from pmndrs/gltfjsx
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.js
More file actions
executable file
路40 lines (35 loc) 路 1009 Bytes
/
Copy pathcli.js
File metadata and controls
executable file
路40 lines (35 loc) 路 1009 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
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env node
'use strict'
const React = require('react')
const importJsx = require('import-jsx')
const { render } = require('ink')
const meow = require('meow')
const App = importJsx('./src/components/App')
const cli = meow(
`
Usage
$ gltfjsx [Model.js] [options]
Options
--types, -t Add Typescript definitions
--verbose, -v Verbose output w/ names and empty groups
--precision, -p Number of fractional digits (default: 2)
--draco, -d Draco binary path
--root, -r Sets directory from which .gltf file is served
Examples
$ gltfjsx model.glb
`,
{
flags: {
types: { type: 'boolean', alias: 't' },
verbose: { type: 'boolean', alias: 'v' },
precision: { type: 'number', alias: 'p', default: 2 },
draco: { type: 'string', alias: 'd' },
root: { type: 'string', alias: 'r' },
},
}
)
if (cli.input.length === 0) {
console.log(cli.help)
} else {
render(React.createElement(App, { file: cli.input[0], ...cli.flags }))
}