import { docopt } from 'docopt'; import { readFileSync } from 'fs'; import { join } from 'path'; import { Options } from './types'; import createServer from './server'; const ARG_DATA = readFileSync(join(__dirname, '..', 'src', 'cli.txt')).toString(); function getArgs() : Options { const rawArgs = docopt(ARG_DATA, { version: require('../package.json').version, help: true }); return { allowed_ips: rawArgs['--ips'] ? rawArgs['--ips'].split(',') : [], basicAuth: rawArgs['--basic-auth'] ? rawArgs['--basic-auth'].split(':') : [], dirList: rawArgs['--list-dir'], serveDir: rawArgs['