OptionKit icon indicating copy to clipboard operation
OptionKit copied to clipboard

Better docs and examples

Open cheizer opened this issue 9 years ago • 1 comments

Hello, I like the concept of your project and would like to use it a bit more. It's fine if I have one option but it seems to break on multiple options.

(e.g. myApp -e Hello -a AnotherValue)

Result: opt1: rest = ["Hello", "AnotherValue"]

Expected: rest = "Hello"

opt3: rest = ["Hello", "AnotherValue"]

Expected: rest = "AnotherValue"

cheizer avatar Jul 01 '16 20:07 cheizer

Hi @cheizer! I just had the same problem... the rest has no relation to which argument it belonged to, it's just all argument values combined :/

I think the input should come as the value of the options array. That way one could query it like

if let option1Argument = options[option1] {
  // use specific information
}

fruitcoder avatar Jul 14 '16 11:07 fruitcoder