Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apache CLI option value with whitespace

I'm using Apache CLI to parse command line arguments. One of my arguments is a filter that takes a string MyApp -f "search for this string"

I thought when i do cmdLine.getOptionValue("f") it would return: search for this string

However it just returns search

What should I do to ensure that the entire string is retrieved, apparently just wrapping it in double quotes doesn't seem to work.

I'm on ubuntu.

like image 856
hba Avatar asked Sep 16 '13 23:09

hba


1 Answers

I think passing the string with extra single quotes should work:

MyApp -f "'search for this string'"
like image 112
cabad Avatar answered Nov 04 '22 17:11

cabad