On 2021-10-18 15:14, matthias rebbe via use-livecode wrote:
Hello,

is there anyone who uses the Command-line argument parser library?

I am not sure how i can get the value that is attached as parameter
when the programm is started from the command-line

Let's say i call my program like this      ./myprogram -m=SomeParam

So how do i get the value SomeParam?I thought it is in the array after
getop() is called.

My code looks like this

put getopt("m,macadress") into tParams
if "macadress" is among the keys of tParams["options"]
then put tParams["options"]["macadress"] into tValue

You are using it correctly - but I think you've omitted a `=` from the end of the option specification:

Each option specification can end with a `=`.  This indicates that
the option expects an argument.  For example, with the grammar
`-o,--output=`, the option can be specified like `-o file`, `-ofile`,
`--output file`, or `--output=file`.

[ FWIW there is a 'typo' in the docs there the grammer being exhibited should be `o,output=` I think! ]

Warmest Regards,

Mark.

--
Mark Waddingham ~ [email protected] ~ http://www.livecode.com/
LiveCode: Everyone can create apps

_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to