-O=`busybox getopt -q -l content: -l help -l title: -l id: -l url: -- c:hi:t:u: "$@"`
-if [ $? != 0 ] ; then show_usage; exit 1 ; fi
-eval set -- "$O"
-while true; do
-case "$1" in
- -c|--content) PARAMS="$PARAMS --es content '$2'"; CONTENT_OR_TITLE_SET=yes; shift 2;;
- -h|--help) show_usage; exit 0;;
- -i|--id) PARAMS="$PARAMS --es id $2"; shift 2;;
- -t|--title) PARAMS="$PARAMS --es title '$2'"; CONTENT_OR_TITLE_SET=yes; shift 2;;
- -u|--url) PARAMS="$PARAMS --es url '$2'"; shift 2;;
- --) shift; break;;
- *) echo Error; exit 1;;
-esac
+CONTENT_OR_TITLE_SET=no
+ARG_C=""
+OPT_C=""
+ARG_I=""
+OPT_I=""
+ARG_T=""
+OPT_T=""
+ARG_U=""
+OPT_U=""
+
+while getopts :hc:i:t:u: option
+do
+ case "$option" in
+ h) show_usage;;
+ c) ARG_C="--es content"; OPT_C="$OPTARG"; CONTENT_OR_TITLE_SET=yes;;
+ i) ARG_I="--es id"; OPT_I="$OPTARG";;
+ t) ARG_T="--es title"; OPT_T="$OPTARG"; CONTENT_OR_TITLE_SET=yes;;
+ u) ARG_U="--es url"; OPT_U="$OPTARG";;
+ ?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
+ esac