geofences/src/config.ts
Wolfgang Hottgenroth 30fbbd2589 initial
2018-02-26 12:55:13 +01:00

20 lines
421 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: '~/geofences.conf' }
];
export let dict : any
export function readConfig() {
let options = cmdargs(OPTION_DEFINITIONS)
dict = JSON.parse(fs.readFileSync(options.config, "utf8"))
}
readConfig()