archimatetool/archi-scripting-plugin

Use a double hyphen for the argument example in the wiki

5-tom opened this issue · 3 comments

This issue concerns the $.process.argv (was getArgs()) section of the wiki. A '-' is being used when '--' should be.
'-' are for flags
'--' are for options

When I use a simple options parser like minimist I get:

{_: [], m: true, y: true, A: true, r: true, g: true}

because it thinks -myArg is -m -y -A -r -g

I believe you want this result:
{_: [], myArg: "HelloWord"}

So you should use --myArg "HelloWorld" in the wiki.

$.process.argv is a wrapper around Eclipse code. See

argv: Java.type("org.eclipse.core.runtime.Platform").getApplicationArgs(),

Eclipse itself uses a mixture of '-' and '--' when setting options. In fact, org.eclipse.core.runtime.Platform.getApplicationArgs() returns arguments whether they have one, two or even three hyphens. So it doesn't matter. I'll update the wiki to show both.

I've updated the wiki with a note to say you can use one or two hyphens.

Please close this issue if that answers it!

Amazing, thank you!