Generic tracing; removed iso14a_XX-functions, removed traceLen as global varible
[legacy-proxmark3.git] / client / scripts / parameters.lua
blobfa260204f19f654e8aae33dc3afd02267abd8798
2 -- The getopt-functionality is loaded from pm3/getopt.lua
3 -- Have a look there for further details
4 getopt = require('getopt')
6 usage = "script run parameters.lua -a 1 -blala -c -de"
7 author = "Martin Holst Swende"
8 desc =[[
9 This is an example script to demonstrate handle parameters in scripts.
10 For more info, check the comments in the code
13 local function main(args)
15 print(desc)
16 print("These parameters were passed")
17 --[[
18 When passing parameters,
19 x: means that a value should follow x
20 y means that 'y' is a flag, either on or off
21 So, the string a:b:def means that we support up to
22 5 parameters; two with values and three flags. The following
23 should be valid:
25 script run parameters.lua -a 1 -blala -c -de
27 Notice two things:
28 1. 'blala' works just like 'b lala', both set 'b' to 'lala'
29 2. Flags can be put together, '-de' is the same as '-d -e'
30 3. The format -b=lala is *not* supported
31 4. The format b lala (without -) is *not* supported
32 --]]
34 for o, a in getopt.getopt(args, 'a:b:ced') do
35 print(o, a)
36 end
37 end
40 --[[
41 In the future, we may implement so that scripts are invoked directly
42 into a 'main' function, instead of being executed blindly. For future
43 compatibility, I have done so, but I invoke my main from here.
44 --]]
45 main(args)