mirror of
https://github.com/TangentFoxy/argparse.git
synced 2025-07-28 11:02:20 +00:00
@@ -19,9 +19,10 @@ parser:option("-o --output", "Output file.", "a.out")
|
|||||||
parser:option("-I --include", "Include locations."):count("*")
|
parser:option("-I --include", "Include locations."):count("*")
|
||||||
|
|
||||||
local args = parser:parse()
|
local args = parser:parse()
|
||||||
print(args) -- Assuming print is patched to handle tables nicely.
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
`args` contents depending on command line arguments:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ lua script.lua foo
|
$ lua script.lua foo
|
||||||
```
|
```
|
||||||
@@ -46,6 +47,8 @@ $ lua script.lua foo -I/usr/local/include -Isrc -o bar
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Error messages depending on command line arguments:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ lua script.lua foo bar
|
$ lua script.lua foo bar
|
||||||
```
|
```
|
||||||
|
Reference in New Issue
Block a user