Make parse_options work with everything: cmd line, config files, values with spaces, op val, op=val, etc.

This commit is contained in:
Daniel Nichter
2012-01-23 10:30:42 -07:00
parent 65a3ab5157
commit 0d348ce289
5 changed files with 89 additions and 15 deletions

View File

@@ -182,8 +182,8 @@ The syntax of the configuration files is as follows:
=item *
Whitespace followed by a hash (#) sign signifies that the rest of the line is a
comment. This is deleted.
Whitespace followed by a hash sign (#) signifies that the rest of the line is a
comment. This is deleted. For example:
=item *
@@ -200,7 +200,9 @@ Each line is permitted to be in either of the following formats:
option
option=value
Whitespace around the equals sign is deleted during processing.
Do not prefix the option with C<-->. Do not quote the values, even if
it has spaces; value are literal. Whitespace around the equals sign is
deleted during processing.
=item *
@@ -214,6 +216,22 @@ program.
=back
=head2 EXAMPLE
This config file for pt-stalk,
# Config for pt-stalk
variable=Threads_connected
cycles=2 # trigger if problem seen twice in a row
--
--user daniel
is equivalent to this command line:
pt-stalk --variable Threads_connected --cycles 2 -- --user daniel
Options after C<--> are passed literally to mysql and mysqladmin.
=head2 READ ORDER
The tools read several configuration files in order: