ctubbsii commented on a change in pull request #21: Add debug flag to runex 
Fixes #18
URL: https://github.com/apache/accumulo-examples/pull/21#discussion_r180590363
 
 

 ##########
 File path: bin/runex
 ##########
 @@ -16,10 +16,24 @@
 # limitations under the License.
 
 main_class="$1"
-main_args="${*:2}"
+mvn_opts="-q"
+main_args=()
+
+shift
+while [[ $# -gt 0 ]] ; do
+  case $1 in
+    -d|--debug)
 
 Review comment:
   Stealing arguments from the main class seems like it will be prone to 
errors... you never know if it was intended to be part of the main class or 
part of the script.
   
   A better strategy would be to detect a DEBUG flag from the environment, as 
in:
   
   ```bash
   DEBUG=true ./runex ...
   ```
   
   or perhaps more familiar,
   
   ```bash
   export DEBUG=true
   ./runex ...
   ```
   
   Could also use something more explicit:
   
   ```bash
   export RUNEX_MVN_ARG="-X"
   ./runex ...
   ```
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to