SOLR-7832: bin/post now allows either -url or -c, rather than requiring both

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1693958 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Erik Hatcher 2015-08-03 19:34:21 +00:00
parent 2c0b36bf0a
commit 4f065ce777
2 changed files with 8 additions and 3 deletions

View File

@ -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 release

View File

@ -135,7 +135,7 @@ while [ $# -gt 0 ]; do
shift
COLLECTION="$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`
shift
PROPS+=("-Dport=$1")
elif [[ ("$1" == "-d" || "$1" == "--data" || "$1" == "-") ]]; then
@ -156,6 +156,9 @@ while [ $# -gt 0 ]; do
shift
# echo "$1: PROP"
PROPS+=("-D$key=$1")
if [[ "$key" == "url" ]]; then
SOLR_URL=$1
fi
fi
else
echo -e "\nUnrecognized argument: $1\n"
@ -167,8 +170,8 @@ while [ $# -gt 0 ]; do
done
# 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 1
fi