epugh commented on code in PR #3240: URL: https://github.com/apache/solr/pull/3240#discussion_r1983432038
########## solr/core/src/java/org/apache/solr/cli/CLIUtils.java: ########## @@ -216,12 +217,32 @@ public static String normalizeSolrUrl(CommandLine cli) throws Exception { } /** - * Get the ZooKeeper connection string from either the zk-host command-line option or by looking - * it up from a running Solr instance based on the solr-url option. + * Get the value of the specified CLI option with fallback to system property and default value. + * + * @param cli the command line + * @param option the commons cli {@link Option} + * @param sysprop the system property to fall back to + * @param defaultValue the default value. Use null if no default value is desired + * @return the value of the option or system property or the default value + */ + public static String getCliOptionOrPropValue( + CommandLine cli, Option option, String sysprop, String defaultValue) { + String value = cli.getOptionValue(option); Review Comment: I think doing the same for SOLR_URL makes sense. It could be another PR, but it could also be in this PR! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org