/** * Init a subject from the command line and throw an exception if not * successful. * * @see initSubject(ArgumentMap) * @param argMap * @return */ public static Subject initSubject(ArgumentMap argMap) { return initSubject(argMap, false); }
subject = CertCmdArgUtil.initSubject(argMap);
} else if (argMap.isSet("cert")) { this.subject = CertCmdArgUtil.initSubject(argMap);
public static void main(String[] args) { ArgumentMap argMap = new ArgumentMap(args); if (argMap.isSet(ARG_HELP) || argMap.isSet(ARG_H)) { usage(); System.exit(0); } // Set debug mode if (argMap.isSet(ARG_DEBUG) || argMap.isSet(ARG_D)) { Log4jInit.setLevel("ca.nrc.cadc.ac.client", Level.DEBUG); Log4jInit.setLevel("ca.nrc.cadc.net", Level.DEBUG); } else if (argMap.isSet(ARG_VERBOSE) || argMap.isSet(ARG_V)) { Log4jInit.setLevel("ca.nrc.cadc.ac.client", Level.INFO); } else Log4jInit.setLevel("ca", Level.WARN); Main main = new Main(argMap); Subject subject = CertCmdArgUtil.initSubject(argMap, true); final Object response; if (subject != null) response = Subject.doAs(subject, main); else response = main.run(); log.debug("Response: " + response); }