code: def main(argv=None):
      
      args = _parse_args((argv if argv else sys.argv)[1:])
      cnf = os.environ.copy() if args.env else {}
  
      extra_opts = dict()
      if args.extra_opts:
          extra_opts = anyconfig.parser.parse(args.extra_opts)
  
      diff = _load_diff(args, extra_opts)
  
      if cnf:
          API.merge(cnf, diff)
      else:
          cnf = diff
  
      if args.args:
          diff = anyconfig.parser.parse(args.args)
          API.merge(cnf, diff)
  
      if args.validate:
          _exit_with_output("Validation succeds")
  
      cnf = API.gen_schema(cnf) if args.gen_schema else _do_filter(cnf, args)
      _output_result(cnf, args.output, args.otype, args.inputs, args.itype,
                     extra_opts=extra_opts)
docs: :param argv: Argument list to parse or None (sys.argv will be set).