Timeline for How to extract unknown arguments within a shell script?
Current License: CC BY-SA 3.0
14 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 3, 2024 at 16:40 | answer | added | Al Conrad | timeline score: 0 | |
| Apr 29, 2015 at 11:25 | answer | added | XZS | timeline score: 0 | |
| Apr 29, 2015 at 11:01 | history | edited | XZS | CC BY-SA 3.0 |
The second example was actually valid in terms of usual option handling
|
| Apr 29, 2015 at 1:14 | answer | added | Janis | timeline score: 1 | |
| Apr 28, 2015 at 21:58 | comment | added | XZS | Assuming a stable API (which is reasonable in this case), another problem still remains: Duplication - of the parsing routine from the wrapped program in the wrapper - is also bad practice. :( | |
| Apr 28, 2015 at 21:54 | comment | added | eyoung100 | As a matter of programming practice, no option should ever be unknown. As such it will be in a manpage somewhere | |
| Apr 28, 2015 at 21:52 | comment | added | XZS | Indeed, i could also copy the complete parseopts routine and everything from makepkg's parsing into the wrapper. As this is not very portable (for example, when an option changes), I would consider this as a last resort. This question should be more generally applicable: how can a shell script pass on all options it does not want to parse itself? | |
| Apr 28, 2015 at 21:48 | history | edited | Totor | CC BY-SA 3.0 |
previous edit was inaccurate / does not comply with the OP's question
|
| S Apr 28, 2015 at 21:45 | history | suggested | happycorsair | CC BY-SA 3.0 |
just improved your topic
|
| Apr 28, 2015 at 21:41 | review | Suggested edits | |||
| S Apr 28, 2015 at 21:45 | |||||
| Apr 28, 2015 at 21:39 | comment | added | eyoung100 |
then type man makepkg that should give you a list of options.
|
|
| Apr 28, 2015 at 21:36 | comment | added | XZS |
@eyoung100 Do you mean the options of the program I am passing to? (It is Arch Linux' makepkg.) It has many different options with and without arguments, so they would be very difficult to parse themselves.
|
|
| Apr 28, 2015 at 21:29 | comment | added | eyoung100 |
Have you considered using -h or --help to list all the options?
|
|
| Apr 28, 2015 at 21:18 | history | asked | XZS | CC BY-SA 3.0 |