@plastichub/osr-cad
Version:
This is a CLI(CommandLineInterface) toolset to convert 3D files, using Solidworks and other software.
59 lines • 2.19 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.register = exports.defaultOptions = void 0;
const __1 = require("../");
const sw_argv_1 = require("../sw_argv");
const index_1 = require("../cad/index");
const defaultOptions = (yargs) => {
return yargs.option('src', {
default: './',
describe: 'The source directory or source file. Glob patters are supported!',
demandOption: true
}).option('dst', {
describe: 'Destination folder or file'
}).option('view', {
default: 'Isometric',
describe: 'Sets the target view'
}).option('Report', {
describe: 'Optional conversion report. Can be JSON, HTML, CSV or Markdown'
}).option('debug', {
default: false,
describe: 'Enable internal debug messages',
type: 'boolean'
}).option('skip', {
default: true,
describe: 'Skip existing files',
type: 'boolean',
}).option('dry', {
default: false,
describe: 'Run without conversion but create reports',
type: 'boolean'
}).option('alt', {
default: false,
describe: 'Alternate tokenizer'
}).option('verbose', {
default: true,
describe: 'Show internal messages',
type: 'boolean'
}).option('sw', {
describe: 'Set explicit the path to the Solidworks binaries & scripts.\
"It assumes SolidWorks.Interop.sldworks.dll and export.cmd at this location!'
}).option('script', {
describe: 'Set explicit the path to the Solidworks script'
});
};
exports.defaultOptions = defaultOptions;
let options = (yargs) => (0, exports.defaultOptions)(yargs);
const register = (cli) => {
return cli.command('pack', '', options, async (argv) => {
if (argv.help) {
return;
}
const options = (0, sw_argv_1.sanitizeSingle)(argv);
__1.logger.setSettings({ minLevel: options.logLevel });
__1.logger.debug("options " + argv.dst, options);
return (0, index_1.pack)(options);
});
};
exports.register = register;
//# sourceMappingURL=pack.js.map