summaryrefslogtreecommitdiff
path: root/shared/option-parser.c
Commit message (Collapse)AuthorAgeFilesLines
* option-parser: Handle short double-arg optionsBryce Harrington2016-03-081-3/+38
| | | | | | | | | | | | | | weston allows both short and long style options to take arguments. In the case of short options, allow an optional space between the option name and value. E.g., previously you could launch weston this way: weston -i2 -cmyconfig.ini now you can also launch it like this: weston -i 2 -c myconfig.ini Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
* shared: Update boilerplate from MIT X11 license to MIT Expat licenseBryce Harrington2015-06-151-16/+19
|
* parse_options: fail on more malformed optionsBill Spitzak2014-09-111-28/+69
| | | | | | | | | | | | | Fail on trailing text after numbers, such as --width=100mm Fail on any text after booleans, such as --flag=false Also fixed reading of memory after the null terminator of a long option with no = sign in it. [Pekka Paalanen: some whitespace style fixes.] Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
* configure.ac: Enable AC_USE_SYSTEM_EXTENSIONSDaniel Stone2013-06-051-0/+2
| | | | | | | | | | | | | | | | | | AC_USE_SYSTEM_EXTENSIONS enables _XOPEN_SOURCE, _GNU_SOURCE and similar macros to expose the largest extent of functionality supported by the underlying system. This is required since these macros are often limiting rather than merely additive, e.g. _XOPEN_SOURCE will actually on some systems hide declarations which are not part of the X/Open spec. Since this goes into config.h rather than the command line, ensure all source is consistently including config.h before anything else, including system libraries. This doesn't need to be guarded by a HAVE_CONFIG_H ifdef, which was only ever a hangover from the X.Org modular transition. Signed-off-by: Daniel Stone <daniel@fooishbar.org> [pq: rebased and converted more files]
* Pass argc pointer to parse_options()Kristian Høgsberg2013-02-201-2/+3
| | | | | This lets us keep argc up to date as the backend picks out arguments from the argv array.
* Add an option parserKristian Høgsberg2012-03-121-0/+82
On one hand, getopt (in particular the -o suboption syntax) sucks on the server side, and on the client side we would like to avoid the glib dependency. We can roll out own option parser and solve both problems and save a few lines of code total.