Apache Lucene open-source search software
SOLR-7832: bin/post now allows either -url or -c, rather than requiring both
Erik Hatcher4f065ce7775a
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txtindex 18da1bceb50..2fd44cf4966 100644--- a/solr/CHANGES.txt+++ b/solr/CHANGES.txt@@ -403,6 +403,8 @@ Other Changes* SOLR-7863: Lowercase the CLUSTERPROP command in ZkCLI for consistency, print error for unknown cmd (janhoy)+* SOLR-7832: bin/post now allows either -url or -c, rather than requiring both. (ehatcher)+================== 5.2.1 ==================Consult the LUCENE_CHANGES.txt file for additional, low level, changes in this releasediff --git a/solr/bin/post b/solr/bin/postindex d0a39e13033..39b2431c656 100755--- a/solr/bin/post+++ b/solr/bin/post@@ -135,7 +135,7 @@ while [ $# -gt 0 ]; doshiftCOLLECTION="$1"elif [[ "$1" == "-p" ]]; then- # -p => -port for convenience and compatability with bin/solr start+ # -p alias for -port for convenience and compatibility with `bin/solr start`shiftPROPS+=("-Dport=$1")elif [[ ("$1" == "-d" || "$1" == "--data" || "$1" == "-") ]]; then@@ -156,6 +156,9 @@ while [ $# -gt 0 ]; doshift# echo "$1: PROP"PROPS+=("-D$key=$1")+ if [[ "$key" == "url" ]]; then+ SOLR_URL=$1+ fifielseecho -e "\nUnrecognized argument: $1\n"@@ -167,8 +170,8 @@ while [ $# -gt 0 ]; dodone# Check for errors-if [[ $COLLECTION == "" ]]; then- echo -e "\nCollection must be specified. Use -c <collection name> or set DEFAULT_SOLR_COLLECTION in your environment.\n"+if [[ $COLLECTION == "" && $SOLR_URL == "" ]]; then+ echo -e "\nCollection or URL must be specified. Use -c <collection name> or set DEFAULT_SOLR_COLLECTION in your environment, or use -url instead.\n"echo -e "See '$THIS_SCRIPT -h' for usage instructions.\n"exit 1fi