https://kotlinlang.org logo
#clikt
Title
# clikt
j

jeff

02/01/2023, 5:26 PM
Maybe i’m being obtuse, but can I have an option accept a string that includes whitespace? This:
Copy code
script --some-option="two words"
sets
--some-option
to
two
and then passes
words
as an argument
a

AJ Alt

02/01/2023, 9:37 PM
Yes, that should work fine. Your shell is responsible for tokenizing, if a quoted string is split up, that's done before clikt sees it. (you can confim that by just printing
argv
). Are you doing some
$@
argument expansion in a bash script and missing quotes?
j

jeff

02/01/2023, 9:44 PM
Are you doing some
$@
argument expansion in a bash script and missing quotes?
I sure am, that was exactly it. Fixed now. Thanks! (and fantastic library by the way)
5 Views