hi, quick question: I do have compiled a kotlin pr...
# announcements
s
hi, quick question: I do have compiled a kotlin project to a jar file. now I want to pass parameters, I do so java -jar bg.jar --angle 2. However java -jar bg.jar --angle '-2' does not work.
Exception in thread "main" java.lang.IllegalStateException: Missing value for CLI argument --angle
probably not related to Kotlin, I apologize, but maybe somebody can hint how to do this? I seem right now I can't wrap my head around this triviality.
thanks!
c
sorry for the quick gun jump here but it seems the parameter is not being recognized, maybe it’s not a string value?
s
yeah you are right, it's not a string value. so I need negative numbers, should I make this angle parameter a string param? then parse teh double
@Cicero oh well that's my own code, never mind. lol. 🙂 found the problem
🎉 1
for some reason I had weird custom command line argument parsing in my code
there are option parsers for kotlin, right? so I don't have to do this.
guess that was pretty old code
well i mean in the standard library
c
😅 I’m happy to help?
s
What I meant was: Is there a standard way to handle commadn line arguments in Kotlin.
like a standard argument parsing library
c
Do I understand it’s something “like this”: Reading a name from the command line | Try Kotlin (kotlinlang.org)
s
yeah i thought about using https://github.com/Kotlin/kotlinx-cli
but I didn't want to include any non-standard dependencies into the project actually
standard librry dependencies
c
I know what you mean but this library tells me something like you would need to use it
When you find this kind of thing inside of the Kotlin repo, then it’s kind of unavoidable
s
I'm just baffeld what to use.
for now I'm using a little code to manage CLI arguments myself
so no additional library needed
c
Cool, but I would go with Kotlin repo solution always, even then argparser looks fancier.
s
What is Kotlin repo solution?
s
thanks
i see