message: feat(cli): added support for JSON string value for --options CLI argument
  closes
diff: @@ -69,9 +69,11 @@ YargsParser.command(
  watch: argv.watch as boolean,
  templateFileName: argv.template as string,
  templateOptions: argv.templateOptions || {},
  - redocOptions: argv.options || {},
  + redocOptions: getObjectOrJSON(argv.options),
  };
  + console.log(config);
  +
  try {
  await serve(argv.port as number, argv.spec as string, config);
  } catch (e) {
  @@ -124,7 +126,7 @@ YargsParser.command(
  disableGoogleFont: argv.disableGoogleFont as boolean,
  templateFileName: argv.template as string,
  templateOptions: argv.templateOptions || {},
  - redocOptions: argv.options || {},
  + redocOptions: getObjectOrJSON(argv.options),
  };
  try {
  @@ -353,3 +355,15 @@ function handleError(error: Error) {
  console.error(error.stack);
  process.exit(1);
  }
  +
  +function getObjectOrJSON(options) {
  + try {
  + return options && typeof options === 'string'
  + ? JSON.parse(options) : options
  + ? options
  + : {};
  + } catch (e) {
  + console.log(`Encountered error:\n${options}\nis not a valid JSON.`);
  + handleError(e);
  + }
  +}
  