Files
dispatcher_ng/src/config.ts
Wolfgang Hottgenroth 8d85314fc9 typescriptifying
2018-01-09 16:36:14 +01:00

20 lines
425 B
TypeScript

import * as fs from 'fs'
import * as cmdargs from 'command-line-args'
const OPTION_DEFINITIONS = [
{ name: 'verbose', alias: 'v', type: Boolean },
{ name: 'config', alias: 'c', type: String, defaultValue: '~/dispatcher_ng.conf' }
];
export let dict : any
export function readConfig() {
let options = cmdargs(OPTION_DEFINITIONS)
dict = JSON.parse(fs.readFileSync(options.config, "utf8"))
}
readConfig()