package.xml0000664000175000017500000012723213102315277011307 0ustar janjan Horde_Argv pear.horde.org Argv Horde command-line argument parsing package Classes for parsing command line arguments with various actions, providing help, grouping options, and more. Jan Schneider jan jan@horde.org yes Chuck Hagenbuch chuck chuck@horde.org no Mike Naberezny mnaberez mike@maintainable.com no 2017-05-03 2.1.0 1.1.0 stable stable BSD-2-Clause * [jan] Colorize output. * [jan] Add Horde_Argv_HelpFormatter#highlightHeading() and Horde_Argv_HelpFormatter#highlightOption(). 5.3.0 8.0.0alpha1 8.0.0alpha1 1.7.0 Horde_Cli pear.horde.org 2.2.0 3.0.0alpha1 3.0.0alpha1 Horde_Exception pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_Translation pear.horde.org 2.2.0 3.0.0alpha1 3.0.0alpha1 Horde_Util pear.horde.org 2.0.0 3.0.0alpha1 3.0.0alpha1 Horde_Test pear.horde.org 2.1.0 3.0.0alpha1 3.0.0alpha1 0.1.0 0.1.0 beta beta 2010-10-22 BSD-2-Clause * Initial release, ported from Optik (http://optik.sourceforge.net/) 1.0.0alpha1 1.0.0 alpha alpha 2011-03-08 BSD-2-Clause * First alpha release for Horde 4. 1.0.0beta1 1.0.0 beta beta 2011-03-16 BSD-2-Clause * First beta release for Horde 4. 1.0.0RC1 1.0.0 beta beta 2011-03-22 BSD-2-Clause * First release candidate for Horde 4. 1.0.0RC2 1.0.0 beta beta 2011-03-29 BSD-2-Clause * Second release candidate for Horde 4. 1.0.0 1.0.0 stable stable 2011-04-06 BSD-2-Clause * First stable release for Horde 4. 1.0.1 1.0.0 stable stable 2011-05-18 BSD-2-Clause * [jan] Updated Spanish translation. 1.0.2 1.0.0 stable stable 2011-06-01 BSD-2-Clause * [jan] Updated Slovak translation. 1.0.3 1.0.0 stable stable 2011-07-05 BSD-2-Clause * [jan] Update Lithuanian translation. 1.0.4 1.0.0 stable stable 2011-07-27 BSD-2-Clause * [jan] Update Latvian translation. 1.0.5 1.0.0 stable stable 2011-11-22 BSD-2-Clause * [jan] Update Estonian translation. * [jan] Fix tests to work with PHPUnit 3.6. 2.0.0alpha1 1.0.0 alpha stable 2012-07-05 BSD-2-Clause * First alpha release for Horde 5. 2.0.0beta1 1.0.0 beta stable 2012-07-19 BSD-2-Clause * First beta release for Horde 5. 2.0.0 1.0.0 stable stable 2012-10-30 BSD-2-Clause * First stable release for Horde 5. 2.0.1 1.0.0 stable stable 2012-11-06 BSD-2-Clause * [jan] Update Dutch translation (Arjen de Korte <build+horde@de-korte.org>). 2.0.2 1.0.0 stable stable 2012-11-19 BSD-2-Clause * [mms] Use new Horde_Test layout. 2.0.3 1.0.0 stable stable 2013-01-09 BSD-2-Clause * [jan] Update Basque translation (Ibon Igartua <ibon.igartua@ehu.es>). 2.0.4 1.0.0 stable stable 2013-01-29 BSD-2-Clause * [jan] Update French translation (Paul De Vlieger <paul.de_vlieger@moniut.univ-bpclermont.fr>). 2.0.5 1.0.0 stable stable 2013-03-05 BSD-2-Clause * [jan] Add extensive documention. 2.0.6 1.0.0 stable stable 2013-04-04 BSD-2-Clause * [jan] Fix documentation formatting. 2.0.7 1.0.0 stable stable 2013-04-04 BSD-2-Clause * [jan] Re-release of broken package. 2.0.8 1.0.0 stable stable 2014-04-03 BSD-2-Clause * [jan] Update Ukrainian translation. 2.0.9 1.0.0 stable stable 2014-05-21 BSD-2-Clause * [jan] Update Hungarian translation (Andras Galos <galosa@netinform.hu>). 2.0.10 1.0.0 stable stable 2015-01-08 BSD-2-Clause * [jan] Support loading translations from Composer-installed package. * [jan] Improve PSR-2 compatibility. 2.0.11 1.0.0 stable stable 2015-04-28 BSD-2-Clause * [jan] Fix issues with certain locales like Turkish. 2.0.12 1.0.0 stable stable 2016-02-01 BSD-2-Clause * [jan] Mark PHP 7 as supported. 2.1.0 1.1.0 stable stable 2017-05-03 BSD-2-Clause * [jan] Colorize output. * [jan] Add Horde_Argv_HelpFormatter#highlightHeading() and Horde_Argv_HelpFormatter#highlightOption(). Horde_Argv-2.1.0/doc/Horde/Argv/ADVANCED0000664000175000017500000003760313102315276015444 0ustar janjan============ Horde_Argv ============ .. contents:: Contents .. section-numbering:: ---------------- Advanced Usage ---------------- This is reference documentation. If you haven't read the `Basic Usage`_ tutorial document yet, do so now. .. _`Basic Usage`: Basic Usage Creating and populating the parser ================================== There are several ways to populate the parser with options. One way is to pass a list of ``Horde_Argv_Option``s to the ``Horde_Argv_Parser`` constructor: :: $parser = new Horde_Argv_Parser(array('optionList' => array( new Horde_Argv_Option( '-f', '--filename', array('action' => 'store', 'type' => 'string', 'dest' => 'filename')), new Horde_Argv_Option( '-q', '--quiet', array('action' => 'store_false', 'dest' => 'verbose')) ))); For long option lists, it's often more convenient/readable to create the list separately: :: $option_list = array( new Horde_Argv_Option( '-f', '--filename', array('action' => 'store', 'type' => 'string', 'dest' => 'filename')), // ... 17 other options ... new Horde_Argv_Option( '-q', '--quiet', array('action' => 'store_false', 'dest' => 'verbose')) ); $parser = new Horde_Argv_Parser(array('optionList' => $option_list)); Or, you can use the ``addOption()`` method of ``Horde_Argv_Parser`` to add options one at a time: :: $parser = new Horde_Argv_Parser(); $parser->addOption( '-f', '--filename', array('action' => 'store', 'type' => 'string', 'dest' => 'filename') ); $parser->addOption( '-q', '--quiet', array('action' => 'store_false', 'dest' => 'verbose') ); This method makes it easier to track down exceptions raised by the ``Horde_Argv_Option`` constructor, which are common because of the complicated interdependencies among the various keyword arguments -- if you get it wrong, *Horde_Argv* throws an ``InvalidArgumentException``. ``addOption()`` can be called in one of two ways: * pass it an ``Horde_Argv_Option`` instance * pass it any combination of positional and keyword arguments that are acceptable to ``new Horde_Argv_Option()`` (ie., to the ``Horde_Argv_Option`` constructor), and it will create the ``Horde_Argv_Option`` instance for you (shown above) Defining options ================ Each ``Horde_Argv_Option`` instance represents a set of synonymous command-line options, ie. options that have the same meaning and effect, but different spellings. You can specify any number of short or long option strings, but you must specify at least one option string. To define an option with only a short option string: :: new Horde_Argv_Option('-f', ...) And to define an option with only a long option string: :: new Horde_Argv_Option('--foo', ...) The ... represents a set of keyword arguments that define option attributes, i.e. attributes of the ``Horde_Argv_Option`` object. Just which keyword args you must supply for a given ``Horde_Argv_Option`` is fairly complicated (see the various ``_check*()`` methods in the ``Horde_Argv_Option`` class if you don't believe me). If you get it wrong, *Horde_Argv* throws an ``InvalidArgumentException`` explaining your mistake. The most important attribute of an option is its action, ie. what to do when we encounter this option on the command-line. The possible actions are: :``store``: store this option's argument [default] :``store_const``: store a constant value :``store_true``: store a ``TRUE`` value :``store_false``: store a ``FALSE`` value :``append``: append this option's argument to a list :``count``: increment a counter by one :``callback``: call a specified function :``help``: print a usage message including all options and the documentation for them (If you don't supply an action, the default is ``store``. For this action, you may also supply ``type`` and ``dest`` option attributes; see below.) As you can see, most actions involve storing or updating a value somewhere. *Horde_Argv* always creates an instance of ``Horde_Argv_Values`` (referred to as options) specifically for this purpose. Option arguments (and various other values) are stored as attributes of this object, according to the ``dest`` (destination) option attribute. For example, when you call :: $parser->parseArgs(); one of the first things *Horde_Argv* does is create the options object: :: $options = new Horde_Argv_Values(); If one of the options in this parser is defined with :: new Horde_Argv_Option('-f', '--file', array('action' => 'store', 'type' => 'string', 'dest' => 'filename')) and the command-line being parsed includes any of the following: :: -ffoo -f foo --file=foo --file foo then *Horde_Argv*, on seeing the "-f" or "--file" option, will do the equivalent of this: :: $options->filename = 'foo'; Clearly, the ``type`` and ``dest`` arguments are almost as important as ``action``. ``action`` is the only attribute that is meaningful for all options, though, so it is the most important. Option actions ============== The various option actions all have slightly different requirements and effects. Most actions have several relevant option attributes which you may specify to guide *Horde_Argv*'s behaviour; a few have required attributes, which you must specify for any option using that action. * ``store`` [relevant: ``type``, ``dest``, ``nargs``, ``choices``] The option must be followed by an argument, which is converted to a value according to ``type`` and stored in ``dest``. If ``nargs`` > 1, multiple arguments will be consumed from the command line; all will be converted according to ``type`` and stored to ``dest`` as an array. See the "Option types" section below. If ``choices`` is supplied (an array of strings), the ``type`` defaults to ``choice``. If ``type`` is not supplied, it defaults to ``string``. If ``dest`` is not supplied, *Horde_Argv* derives a destination from the first long option strings (e.g., "--foo-bar" implies "foo_bar"). If there are no long option strings, *Horde_Argv* derives a destination from the first short option string (e.g., "-f" implies "f"). Example: :: $parser->addOption('-f'); $parser->addOption('-p', array('type' => 'float', 'nargs' => 3, 'dest' => 'point')); Given the following command line: ``-f foo.txt -p 1 -3.5 4 -fbar.txt`` *Horde_Argv* will set :: $options->f = 'foo.txt'; $options->point = array(1.0, -3.5, 4.0); $options->f = 'bar.txt'; * ``store_const`` [required: ``const``; relevant: ``dest``] The value ``const`` is stored in ``dest``. Example: :: $parser->addOption('-q', '--quiet', array('action' => 'store_const', 'const' => 0, 'dest' => 'verbose')); $parser->addOption('-v', '--verbose', array('action' => 'store_const', 'const' => 1, 'dest' => 'verbose')); $parser->addOption('--noisy', array('action' => 'store_const', 'const' => 2, 'dest' => 'verbose')); If "--noisy" is seen, *Horde_Argv* will set :: $options->verbose = 2; * ``store_true`` [relevant: ``dest``] A special case of ``store_const`` that stores a ``TRUE`` value to ``dest``. * ``store_false`` [relevant: ``dest``] Like ``store_true``, but stores a ``FALSE`` value. Example: :: $parser->addOption(null, '--clobber', array('action' => 'store_true', 'dest' => 'clobber')); $parser->addOption(null, '--no-clobber', array('action' => 'store_false', 'dest' => 'clobber')); * ``append`` [relevant: ``type``, ``dest``, ``nargs``, ``choices``] The option must be followed by an argument, which is appended to the array in ``dest``. If no default value for ``dest`` is supplied, an empty array is automatically created when *Horde_Argv* first encounters this option on the command-line. If ``nargs`` > 1, multiple arguments are consumed, and an array of length ``nargs`` is appended to ``dest``. The defaults for ``type`` and ``dest`` are the same as for the ``store`` action. Example: :: $parser->addOption('-t', '--tracks', array('action' => 'append', 'type' => 'int')); If "-t3" is seen on the command-line, *Horde_Argv* does the equivalent of: :: $options->tracks = array(); $options->tracks[] = intval('3'); If, a little later on, "--tracks=4" is seen, it does: :: $options->tracks[] = intval('4'); * ``count`` [relevant: ``dest``] Increment the integer stored at ``dest``. ``dest`` is set to zero before being incremented the first time (unless you supply a default value). Example: :: $parser->addOption('-v', array('action' => 'count', 'dest' => 'verbosity')); The first time "-v" is seen on the command line, *Horde_Argv* does the equivalent of: :: $options->verbosity = 0; $options->verbosity += 1; Every subsequent occurrence of "-v" results in :: $options->verbosity += 1; * ``callback`` [required: ``callback``; relevant: ``type``, ``nargs``, ``callback_args``, ``callback_kwargs``] Call the function specified by ``callback``. The signature of this function should be :: func(Horde_Argv_Option $option, string $opt, mixed $value, Horde_Argv_Parser $parser, array $args, array $kwargs) See Option Callbacks for more detail. * ``help`` [relevant: none] Prints a complete help message for all the options in the current option parser. The help message is constructed from the ``usage`` string passed to ``Horde_Argv_Parser``'s constructor and the ``help`` string passed to every option. If no help string is supplied for an option, it will still be listed in the help message. To omit an option entirely, use the special value ``Horde_Argv_Option::SUPPRESS_HELP``. Example: :: $parser = new Horde_Argv_Parser(); $parser->addOption('-h', '--help', array('action' => 'help')); $parser->addOption('-v', array('action' => 'store_true', 'dest' => 'verbose', 'help' => 'Be moderately verbose')); $parser->addOption('--file', array('dest' => 'filename', 'help' => 'Input file to read data from')); $parser->addOption('--secret', array('help' => Horde_Argv_Option::SUPPRESS_HELP)); If *Horde_Argv* sees either "-h" or "--help" on the command line, it will print something like the following help message to stdout (assuming $_SERVER['argv'][0] is "foo.php"): :: usage: foo.py [options] options: -h, --help Show this help message and exit -v Be moderately verbose --file=FILENAME Input file to read data from After printing the help message, *Horde_Argv* terminates your process with ``exit(0)``. * ``version`` [relevant: none] Prints the version number supplied to the ``Horde_Argv_Parser`` to stdout and exits. The version number is actually formatted and printed by the ``printVersion()`` method of ``Horde_Argv_Parser``. Generally only relevant if the version argument is supplied to the ``Horde_Argv_Parser`` constructor. Option types ============ *Horde_Argv* has six built-in option types: ``string``, ``int``, ``long``, ``choice``, ``float`` and ``complex``. If you need to add new option types, see `Extending Horde_Argv`_. .. _`Extending Horde_Argv`: Extending Horde_Argv Arguments to string options are not checked or converted in any way: the text on the command line is stored in the destination (or passed to the callback) as-is. Integer arguments are passed to ``intval()`` to convert them to PHP integers. If ``intval()`` fails, so will *Horde_Argv*, although with a more useful error message. (Internally, *Horde_Argv* throws ``Horde_Argv_OptionValueException`` from ``Horde_Argv_Option#checkBuiltin()``; ``Horde_Argv_Parser`` catches this exception higher up and terminates your program with a useful error message.) Likewise, float arguments are passed to ``floatval()`` for conversion, long arguments also to ``intval()``, and complex arguments are not handled yet. Apart from that, they are handled identically to integer arguments. ``choice`` options are a subtype of ``string`` options. The ``choices`` option attribute (an array of strings) defines the set of allowed option arguments. ``Horde_Argv_Option#checkChoice()`` compares user-supplied option arguments against this master list and throws ``Horde_Argv_OptionValueException`` if an invalid string is given. Querying and manipulating your option parser ============================================ Sometimes, it's useful to poke around your option parser and see what's there. ``Horde_Argv_Parser`` provides a couple of methods to help you out: :``boolean hasOption(string $opt_str)``: Given an option string such as "-q" or "--verbose", returns ``true`` if the ``Horde_Argv_Parser`` has an option with that option string. :``Horde_Argv_Option getOption(string $opt_str)``: Returns the ``Horde_Argv_Option`` instance that implements the supplied option string, or ``null`` if no options implement it. :``removeOption(string $opt_str)``: If the ``Horde_Argv_Parser`` has an option corresponding to ``$opt_str``, that option is removed. If that option provided any other option strings, all of those option strings become invalid. If ``$opt_str`` does not occur in any option belonging to this ``Horde_Argv_Parser``, throws ``InvalidArgumentException``. Conflicts between options ========================= If you're not careful, it's easy to define conflicting options: :: $parser->addOption('-n', '--dry-run', ...); [...] $parser->addOption('-n', '--noisy', ...); (This is even easier to do if you've defined your own ``Horde_Argv_Parser`` subclass with some standard options.) Every time you add an option, *Horde_Argv* checks for conflicts with existing options. If it finds any, it invokes the current conflict-handling mechanism. You can set the conflict-handling mechanism either in the constructor: :: $parser = new Horde_Argv_Parser(..., array('conflictHandler' => '...')); or with a separate call: :: $parser->setConflictHandler('...'); The available conflict-handling mechanisms are: :``error`` (default): assume option conflicts are a programming error and throws ``Horde_Argv_OptionConflictException`` :``resolve``: resolve option conflicts intelligently (see below) Here's an example: first, define an ``Horde_Argv_Parser`` that resolves conflicts intelligently: :: $parser = new Horde_Argv_Parser(array('conflictHandler' => 'resolve')); Now add all of our options: :: $parser->addOption('-n', '--dry-run', ..., array('help' => 'original dry-run option')); [...] $parser->addOption('-n', '--noisy', ..., array('help' => 'be noisy')); At this point, *Horde_Argv* detects that a previously-added option is already using the "-n" option string. Since ``conflictHandler`` is "resolve", it resolves the situation by removing "-n" from the earlier option's list of option strings. Now, "--dry-run" is the only way for the user to activate that option. If the user asks for help, the help message will reflect that, e.g.: :: options: --dry-run original dry-run option [...] -n, --noisy be noisy Note that it's possible to whittle away the option strings for a previously-added option until there are none left, and the user has no way of invoking that option from the command-line. In that case, *Horde_Argv* removes that option completely, so it doesn't show up in help text or anywhere else. E.g. if we carry on with our existing ``Horde_Argv_Parser``: :: $parser->addOption('--dry-run', ..., array('help' => 'new dry-run option')); At this point, the first "-n/--dry-run" option is no longer accessible, so *Horde_Argv* removes it. If the user asks for help, they'll get something like this: :: options: [...] -n, --noisy be noisy --dry-run new dry-run option Horde_Argv-2.1.0/doc/Horde/Argv/CALLBACKS0000664000175000017500000002621613102315276015554 0ustar janjan============ Horde_Argv ============ ------------------ Option Callbacks ------------------ When *Horde_Argv*'s built-in actions and types aren't quite enough for your needs, you have two choices: extend *Horde_Argv* or define a callback option. Extending *Horde_Argv* is more general, but overkill for a lot of simple cases. Quite often a simple callback is all you need. You define a callback in two steps: * define the option itself using the callback action * write the callback; this is a function (or method) that takes at least four arguments, as described below Defining a callback option ========================== As always, the easiest way to define a callback option is by using the ``addOption()`` method of your ``Horde_Argv_Parser`` object. The only option attribute you must specify is callback, the function to call: :: $parser->addOption('-c', array('action' => 'callback', 'callback' => 'my_callback')); Note that you supply a ``callable`` here -- so you must have already defined a function ``my_callback()`` when you define the ``callback`` option. In this simple case, *Horde_Argv* knows nothing about the arguments the "-c" option expects to take. Usually, this means that the option doesn't take any arguments -- the mere presence of "-c" on the command-line is all it needs to know. In some circumstances, though, you might want your callback to consume an arbitrary number of command-line arguments. This is where writing callbacks gets tricky; it's covered later in this document. *Horde_Argv* always passes four particular arguments to your callback, and it will only pass additional arguments if you specify them via ``callback_args`` and ``callback_kwargs``. Thus, the minimal callback function signature is: :: function my_callback($option, $opt, $value, $parser) The four arguments to a callback are described below. There are several other option attributes that you can supply when you define an option attribute: :``type``: has its usual meaning: as with the ``store`` or ``append`` actions, it instructs *Horde_Argv* to consume one argument and convert it to ``type``. Rather than storing the converted value(s) anywhere, though, *Horde_Argv* passes it to your callback function. :``nargs``: also has its usual meaning: if it is supplied and > 1, *Horde_Argv* will consume ``nargs`` arguments, each of which must be convertible to ``type``. It then passes an array of converted values to your callback. :``callback_args``: an array of extra positional arguments to pass to the callback :``callback_kwargs``: a hash of extra keyword arguments to pass to the callback How callbacks are called ======================== All callbacks are called as follows: :: func(Horde_Argv_Option $option, string $opt, mixed $value, Horde_Argv_Parser $parser, array $args, array $kwargs) where :``$option``: is the ``Horde_Argv_Option`` instance that's calling the callback :``$opt``: is the option string seen on the command-line that's triggering the callback. (If an abbreviated long option was used, ``$opt`` will be the full, canonical option string -- e.g. if the user puts "--foo" on the command-line as an abbreviation for "--foobar", then ``$opt`` will be "--foobar".) :``$value``: is the argument to this option seen on the command-line. *Horde_Argv* will only expect an argument if ``type`` is set; the type of ``$value`` will be the type implied by the option's type (see "Option types" below). If ``type`` for this option is ``null`` (no argument expected), then ``$value`` will be ``null``. If ``nargs`` > 1, ``$value`` will be an array of values of the appropriate type. :``$parser``: is the ``Horde_Argv_Parser`` instance driving the whole thing, mainly useful because you can access some other interesting data through it, as instance attributes: : ``$parser->largs`` : the current list of leftover arguments, ie. arguments that have been consumed but are neither options nor option arguments. Feel free to modify ``$parser->largs``, e.g. by adding more arguments to it. (This list will become ``$args``, the second return value of ``parseArgs()``.) : ``$parser->rargs`` : the current list of remaining arguments, ie. with ``$opt`` and ``$value`` (if applicable) removed, and only the arguments following them still there. Feel free to modify ``$parser->rargs``, e.g. by consuming more arguments. : ``$parser->values`` : the object where option values are by default stored (an instance of ``Horde_Argv_Values``). This lets callbacks use the same mechanism as the rest of *Horde_Argv* for storing option values; you don't need to mess around with globals or closures. You can also access or modify the value(s) of any options already encountered on the command-line. :``$args``: is a tuple of arbitrary positional arguments supplied via the ``callback_args`` option attribute. :``$kwargs``: is a dictionary of arbitrary keyword arguments supplied via ``callback_kwargs``. Error handling ============== The callback function should throw ``Horde_Argv_OptionValueException`` if there are any problems with the option or its argument(s). *Horde_Argv* catches this and terminates the program, printing the error message you supply to stderr. Your message should be clear, concise, accurate, and mention the option at fault. Otherwise, the user will have a hard time figuring out what he did wrong. Examples part 1: no arguments ============================= Here's an example of a callback option that takes no arguments, and simply records that the option was seen: :: function record_foo_seen($option, $opt, $value, $parser) { $parser->saw_foo = true; } $parser->addOption( '--foo', arry('action' => 'callback', 'callback' => 'record_foo_seen') ); Of course, you could do that with the ``store_true`` action. Here's a slightly more interesting example: record the fact that "-a" is seen, but blow up if it comes after "-b" in the command-line. :: $check_order = function($option, $opt, $value, $parser) { if ($parser->values->b) { throw new Horde_Argv_OptionValueException("can't use -a after -b"); } $parser->values->a = 1; } [...] $parser->addOption( '-a', array('action' => 'callback', 'callback' => $check_order) ); $parser->addOption('-b', array('action' => 'store_true', 'dest' => 'b')); If you want to re-use this callback for several similar options (set a flag, but blow up if "-b" has already been seen), it needs a bit of work: the error message and the flag that it sets must be generalized. :: function check_order($option, $opt, $value, $parser) { if ($parser->values->b) { throw new Horde_Argv_OptionValueException(sprintf("can't use %s after -b", $opt)); } $parser->values->{$option->dest} = 1; } [...] $parser->addOption( '-a', array('action' => 'callback', 'callback' => 'check_order', 'dest' => 'a') ); $parser->addOption( '-b', array('action' => 'store_true', 'dest' => 'b') ); $parser->addOption( '-c', array('action' => 'callback', 'callback' => 'check_order', 'dest' => 'c') ); Of course, you could put any condition in there -- you're not limited to checking the values of already-defined options. For example, if you have options that should not be called when the moon is full, all you have to do is this: :: function check_moon($option, $opt, $value, $parser) { if (is_moon_full()) { throw new Horde_Argv_OptionValueException(sprintf('%s option invalid when moon is full', $opt)); } $parser->values->{$option->dest} = 1; } [...] $parser->addOption( '--foo', array('action' => 'callback', 'callback' => 'check_moon', 'dest' => 'foo') ); (The definition of ``is_moon_full()`` is left as an exercise for the reader.) Examples part 2: fixed arguments ================================ Things get slightly more interesting when you define callback options that take a fixed number of arguments. Specifying that a callback option takes arguments is similar to defining a ``store`` or ``append`` option: if you define ``type``, then the option takes one argument that must be convertible to that type; if you further define ``nargs``, then the option takes ``nargs`` arguments. Here's an example that just emulates the standard ``store`` action: :: function store_value($option, $opt, $value, $parser) { $parser->values->{$option->dest} = $value; } [...] $parser->addOption( '--foo', array('action' => 'callback', 'callback' => 'store_value', 'type' => 'int', 'nargs' => 3, 'dest' => 'foo') ); Note that *Horde_Argv* takes care of consuming 3 arguments and converting them to integers for you; all you have to do is store them. (Or whatever: obviously you don't need a callback for this example. Use your imagination!) Examples part 3: variable arguments =================================== Things get hairy when you want an option to take a variable number of arguments. For this case, you must write a callback, as *Horde_Argv* doesn't provide any built-in capabilities for it. And you have to deal with certain intricacies of conventional Unix command-line parsing that *Horde_Argv* normally handles for you. In particular, callbacks have to worry about bare "--" and "-" arguments; the convention is: * bare "--", if not the argument to some option, causes command-line processing to halt and the "--" itself is lost * bare "-" similarly causes command-line processing to halt, but the "-" itself is kept * either "--" or "-" can be option arguments If you want an option that takes a variable number of arguments, there are several subtle, tricky issues to worry about. The exact implementation you choose will be based on which trade-offs you're willing to make for your application (which is why *Horde_Argv* doesn't support this sort of thing directly). Nevertheless, here's a stab at a callback for an option with variable arguments: :: function vararg_callback($option, $opt, $value, $parser) { $done = 0; $value = array(); $rargs = $parser->rargs; while ($rargs) { $arg = $rargs[0]; // Stop if we hit an $arg like '--foo', '-a', '-fx', '--file=f', // etc. Note that this also stops on '-3' or '-3.0', so if // your option takes numeric values, you will need to handle // this. if ((substr($arg, 0, 2) == '--' && strlen($arg) > 2) || ($arg[0] == '-' && strlen($arg) > 1 && $arg[1] != '-')) { break; } else { $value[] = $arg; } array_shift($rargs); } $parser->values->{$option->dest} = $value; } [...] $parser->addOption( '-c', '--callback', array('action' => 'callback', 'callback' => 'vararg_callback') ); The main weakness with this particular implementation is that negative numbers in the arguments following "-c" will be interpreted as further options, rather than as arguments to "-c". Fixing this is left as an exercise for the reader. Horde_Argv-2.1.0/doc/Horde/Argv/COPYING0000664000175000017500000000243013102315276015375 0ustar janjan Copyright 1999-2017 Horde LLC. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE HORDE PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. Horde_Argv-2.1.0/doc/Horde/Argv/DOCS_ORIGIN0000664000175000017500000000142313102315276016065 0ustar janjan====================== Documentation origin ====================== Some of the Horde component documentation is maintained in the Horde wiki. The following list indicates the source locations for some of the files in this directory. :`doc/Horde/Argv/README`_: README :`doc/Horde/Argv/ADVANCED`_: ADVANCED :`doc/Horde/Argv/EXTEND`_: EXTEND :`doc/Horde/Argv/CALLBACKS`_: CALLBACKS .. _doc/Horde/Argv/README: http://wiki.horde.org/Doc/Dev/HordeArgv?actionID=export&format=rst .. _doc/Horde/Argv/ADVANCED: http://wiki.horde.org/Doc/Dev/HordeArgvAdvanced?actionID=export&format=rst .. _doc/Horde/Argv/EXTEND: http://wiki.horde.org/Doc/Dev/HordeArgvExtend?actionID=export&format=rst .. _doc/Horde/Argv/CALLBACKS: http://wiki.horde.org/Doc/Dev/HordeArgvCallbacks?actionID=export&format=rst Horde_Argv-2.1.0/doc/Horde/Argv/EXTEND0000664000175000017500000002115613102315276015262 0ustar janjan============ Horde_Argv ============ ---------------------- Extending Horde_Argv ---------------------- Since the two major controlling factors in how *Horde_Argv* interprets command-line options are the action and type of each option, the most likely direction of extension is to add new actions and new types. Adding new types ================ To add new types, you need to define your own subclass of the ``Horde_Argv_Option class``. This class has a couple of properties that define *Horde_Argv*'s types: ``$TYPES`` and ``$TYPE_CHECKER``. ``$TYPES`` is a tuple of type names; in your subclass, simply define a new tuple ``$TYPES`` that builds on the standard one. ``$TYPE_CHECKER`` is a dictionary mapping type names to type-checking functions. A type-checking function has the following signature: :: foo check_foo(Horde_Argv_Option $option, string $opt, string $value) You can name it whatever you like, and make it return any type you like (e.g. the hypothetical type foo). The value returned by a type-checking function will wind up in the ``Horde_Argv_Values`` instance returned by ``Horde_Argv_Parser->parseArgs()``, or be passed to callbacks as the ``$value`` parameter. Your type-checking function should throw ``Horde_Argv_OptionValueException`` if it encounters any problems. ``Horde_Argv_OptionValueException`` takes a single string argument, which is passed as-is to ``Horde_Argv_Parser``'s ``parserError()`` method, which in turn prepends the program name and the string ``"error:"`` and prints everything to stderr before terminating the process. Here's a silly example that demonstrates adding an imaginary ``MyComplex`` option type to parse complex numbers on the command line. You need to define your type-checker, since it's referred to in the ``$TYPE_CHECKER`` class attribute of your ``Horde_Argv_Option`` subclass: :: class MyOption extends Horde_Argv_Option { public function __construct() { $this->TYPES[] = 'complex'; $this->TYPE_CHECKER['complex'] = 'checkComplex'; } public function checkComplex($option, $opt, $value) { try { return new MyComplex(value); } catch (Exception $e) { throw new Horde_Argv_OptionValueException( sprintf('option %s: invalid complex value: %s', (opt, value)) ); } } } That's it! Now you can write a script that uses the new option type just like any other *Horde_Argv*-based script, except you have to instruct your ``Horde_Argv_Parser`` to use ``MyOption`` instead of ``Horde_Argv_Option``: :: $parser = new Horde_Argv_Parser(array('optionClass' => 'MyOption')); $parser->addOption('-c', array('type' => 'complex')); Alternately, you can build your own option list and pass it to ``Horde_Argv_Parser``; if you don't use ``addOption()`` in the above way, you don't need to tell ``Horde_Argv_Parser`` which option class to use: :: $option_list = array( new MyOption( '-c', array('action' => 'store', 'type' => 'complex', 'dest' => 'c') ) ); parser = new Horde_Argv_Parser(array('optionList' => $option_list)); Adding new actions ================== Adding new actions is a bit trickier, because you have to understand that *Horde_Argv* has a couple of classifications for actions: :"store" actions: actions that result in *Horde_Argv* storing a value to a property of the current ``Horde_Argv_Values`` instance; these options require a ``dest`` attribute to be supplied to the ``Horde_Argv_Option`` constructor :"typed" actions: actions that take a value from the command line and expect it to be of a certain type; or rather, a string that can be converted to a certain type. These options require a type attribute to the ``Horde_Argv_Option`` constructor. These are overlapping sets: some default "store" actions are ``store``, ``store_const``, ``append``, and ``count``, while the default "typed" actions are ``store``, ``append``, and ``callback``. When you add an action, you need to decide if it's a "store" action, a "typed" action, neither, or both. Three class properties of ``Horde_Argv_Option`` (or your ``Horde_Argv_Option`` subclass) control this: :``$ACTIONS``: all actions must be listed in ``$ACTIONS`` :``$STORE_ACTIONS``: "store" actions are additionally listed here :``$TYPED_ACTIONS``: "typed" actions are additionally listed here In order to actually implement your new action, you must override ``Horde_Argv_Option``'s ``takeAction()`` method and add a case that recognizes your action. For example, let's add an ``extend`` action. This is similar to the standard ``append`` action, but instead of taking a single value from the command-line and appending it to an existing list, extend will take multiple values in a single comma-delimited string, and extend an existing list with them. That is, if ``"--names"`` is an ``extend`` option of type ``string``, the command line :: --names=foo,bar --names blah --names ding,dong would result in a list :: array('foo', 'bar', 'blah', 'ding', 'dong') Again we define a subclass of ``Horde_Argv_Option``: :: class MyOption extends Horde_Argv_Option { public function __construct() { $this->ACTIONS[] = 'extend'; $this->STORE_ACTIONS[] = 'extend'; $this->TYPED_ACTIONS[] = 'extend'; } public function takeAction($action, $dest, $opt, $value, $values, $parser) { if ($action == 'extend') { $lvalue = explode(',', $value); $values->dest = array_merge($values->ensureValue('dest', array()), $lvalue); } else { parent::takeAction($action, $dest, $opt, $value, $values, $parser); } } } Features of note: * ``extend`` both expects a value on the command-line and stores that value somewhere, so it goes in both ``$STORE_ACTIONS`` and ``$TYPED_ACTIONS`` * ``MyOption::takeAction()`` implements just this one new action, and passes control back to ``Horde_Argv_Option::takeAction()`` for the standard *Horde_Argv* actions * ``$values`` is an instance of the ``Horde_Argv_Values`` class, which provides the very useful ``ensureValue()`` method. ``ensureValue()`` is essentially a getter with a safety valve; it is called as ``$values->ensureValue($attr, $value)`` If the ``$attr`` property of ``$values`` doesn't exist or is ``null``, then ``ensureValue()`` first sets it to ``$value``, and then returns ``$value``. This is very handy for actions like ``extend``, ``append``, and ``count``, all of which accumulate data in a variable and expect that variable to be of a certain type (an array for the first two, an integer for the latter). Using ``ensureValue()`` means that scripts using your action don't have to worry about setting a default value for the option destinations in question; they can just leave the default as ``null`` and ``ensureValue()`` will take care of getting it right when it's needed. Other reasons to extend Horde_Argv ================================== Adding new types and new actions are the big, obvious reasons why you might want to extend *Horde_Argv*. I can think of at least two other areas to play with. First, the simple one: ``Horde_Argv_Parser`` tries to be helpful by calling ``exit()`` when appropriate, i.e. when there's an error on the command line or when the user requests help. In the former case, the traditional course of letting the script crash with a traceback is unacceptable; it will make users think there's a bug in your script when they make a command-line error. In the latter case, there's generally not much point in carrying on after printing a help message. If this behaviour bothers you, it shouldn't be too hard to "fix" it. You'll have to 1. subclass ``Horde_Argv_Parser`` and override ``parserError()`` 2. subclass ``Horde_Argv_Option`` and override ``takeAction()`` -- you'll need to provide your own handling of the ``help`` action that doesn't call ``exit()`` The second, much more complex, possibility is to override the command-line syntax implemented by *Horde_Argv*. In this case, you'd leave the whole machinery of option actions and types alone, but rewrite the code that processes ``argv``. You'll need to subclass ``Horde_Argv_Parser`` in any case; depending on how radical a rewrite you want, you'll probably need to override one or all of ``parseArgs()``, ``_processLongOpt()``, and ``_processShortOpts()``. Both of these are left as an exercise for the reader. I have not tried to implement either myself, since I'm quite happy with *Horde_Argv*'s default behaviour (naturally). Happy hacking, and don't forget: Use the Source, Luke. Horde_Argv-2.1.0/doc/Horde/Argv/README0000664000175000017500000003311313102315276015224 0ustar janjan============ Horde_Argv ============ .. contents:: Contents .. section-numbering:: *Horde_Argv* is a library for parsing command line arguments with various actions, providing help, grouping options, and more. It is ported from Python's Optik (http://optik.sourceforge.net/). ------------- Basic Usage ------------- While *Horde_Argv* is quite flexible and powerful, you don't have to jump through hoops or read reams of documentation to get started. This document aims to demonstrate some simple usage patterns that will get you started using *Horde_Argv* in your scripts. To parse a command line with *Horde_Argv*, you must create an ``Horde_Argv_Parser`` instance and define some options. You'll have to import the ``Horde_Argv_Parser`` classes in any script that uses *Horde_Argv*, but it is suggested that you use an autoloader instead: :: require_once 'Horde/Autoloader/Default.php'; Early on in the main program, create a parser: :: $parser = new Horde_Argv_Parser(); Then you can start defining options. The basic syntax is: :: $parser->addOption('opt_str', ..., array('attr' => 'value', ...)); That is, each option has one or more option strings, such as "-f" or "--file", and several option attributes that tell *Horde_Argv* what to expect and what to do when it encounters that option on the command line. Typically, each option will have one short option string and one long option string, e.g.: :: $parser->addOption('-f', '--file', ...); You're free to define as many short option strings and as many long option strings as you like, as long as there is at least one option string overall. Once all of your options are defined, instruct *Horde_Argv* to parse your program's command line: :: list($values, $args) = $parser->parseArgs(); (You can pass an argument list to ``parseArgs()`` if you like, but that's rarely necessary: by default it uses $_SERVER['argv'].) ``parseArgs()`` returns two values: * $values is a ``Horde_Argv_Values`` object containing values for all of your options -- e.g. if "--file" takes a single string argument, then $values->file (or $values['file']) will be the filename supplied by the user, or NULL if the user did not supply that option. * $args is the list of arguments left over after parsing options. This tutorial document only covers the four most important option attributes: "action", "type", "dest" (destination), and "help". Of these, "action" is the most fundamental. Option actions ============== Actions tell *Horde_Argv* what to do when it encounters an option on the command line. There is a fixed set of actions hard-coded into *Horde_Argv*; adding new actions is an advanced topic covered in `Extending Horde_Argv`_. Most actions tell *Horde_Argv* to store a value in some variable -- for example, take a string from the command line and store it in an attribute of options. .. _`Extending Horde_Argv`: Extending Horde_Argv If you don't specify an option action, *Horde_Argv* defaults to "store". The store action **************** The most common option action is store, which tells *Horde_Argv* to take the next argument (or the remainder of the current argument), ensure that it is of the correct type, and store it to your chosen destination. For example: :: $parser->addOption( '-f', '--file', array('action' => 'store', 'type' => 'string', 'dest' => 'filename') ); Now let's make up a fake command line and ask *Horde_Argv* to parse it: :: $args = array('-f', 'foo.txt'); list($values, $args) = $parser->parseArgs(args); When *Horde_Argv* sees the "-f", it consumes the next argument, "foo.txt", and stores it in $values->filename, where values is the first return value from ``parseArgs()``. So, after this call to ``parseArgs()``, ``$values->filename`` is "foo.txt". Some other option types supported by *Horde_Argv* are "int" and "float". Here's an option that expects an integer argument: :: $parser->addOption('-n', array('type' => 'int', 'dest' => 'num')); Note that I didn't supply a long option, which is perfectly acceptable. I also didn't specify the action, since the default is "store". Let's parse another fake command-line. This time, we'll jam the option argument right up against the option -- "-n42" (one argument) is equivalent to "-n 42" (two arguments). :: list($values, $args) = $parser->parseArgs(array('-n42')); echo $values->num; will print "42". Trying out the "float" type is left as an exercise for the reader. If you don't specify a type, *Horde_Argv* assumes "string". Combined with the fact that the default action is "store", that means our first example can be a lot shorter: :: $parser->addOption('-f', '--file', array('dest' => 'filename')) If you don't supply a destination, *Horde_Argv* figures out a sensible default from the option strings: if the first long option string is "--foo-bar", then the default destination is "foo_bar". If there are no long option strings, *Horde_Argv* looks at the first short option: the default destination for "-f" is "f". Adding types is covered in "Extending *Horde_Argv*". Handling flag (boolean) options ******************************* Flag options -- set a variable to TRUE or FALSE when a particular option is seen -- are quite common. *Horde_Argv* supports them with two separate actions, "store_true" and "store_false". For example, you might have a verbose flag that is turned on with "-v" and off with "-q": :: $parser->addOption('-v', array('action' => 'store_true', 'dest' => 'verbose')); $parser->addOption('-q', array('action' => 'store_false', 'dest' => 'verbose')); Here we have two different options with the same destination, which is perfectly OK. (It just means you have to be a bit careful when setting default values -- see Default values, below.) When *Horde_Argv* sees "-v" on the command line, it sets the verbose attribute of the special "option values" object to a TRUE value; when it sees "-q", it sets verbose to a FALSE value. Other actions ************* Some other actions supported by *Horde_Argv* are: :"store_const": store a constant value :"append": append this option's argument to a list :"count": increment a counter by one :"callback": call a specified function These are covered in the `Advanced Usage`_ and `Option Callbacks`_ documents. .. _`Advanced Usage`: Advanced Usage .. _`Option Callbacks`: Option Callbacks Default values ============== All of the above examples involve setting some variable (the "destination") when certain command-line options are seen. What happens if those options are never seen? Since we didn't supply any defaults, they are all set to NULL. Usually, this is just fine, but sometimes you want more control. To address that need, *Horde_Argv* lets you supply a default value for each destination, which is assigned before the command-line is parsed. First, consider the verbose/quiet example. If we want *Horde_Argv* to set verbose to TRUE unless "-q" is seen, then we can do this: :: $parser->addOption('-v', array('action' => 'store_true', 'dest' => 'verbose', $default => true)); $parser->addOption('-q', array('action' => 'store_false', 'dest' => 'verbose')); Oddly enough, this is exactly equivalent: :: $parser->addOption('-v', array('action' => 'store_true', 'dest' => 'verbose')); $parser->addOption('-q', array('action' => 'store_false', 'dest' => 'verbose', $default => true)); Those are equivalent because you're supplying a default value for the option's destination, and these two options happen to have the same destination (the verbose variable). Consider this: :: $parser->addOption('-v', array('action' => 'store_true', 'dest' => 'verbose', $default => false)); $parser->addOption('-q', array('action' => 'store_false', 'dest' => 'verbose', $default => true)); Again, the default value for verbose will be TRUE: the last default value supplied for any particular destination attribute is the one that counts. A clearer way to specify default values is the ``setDefaults()`` method of ``Horde_Argv_Parser``, which you can call at any time before calling ``parseArgs()``: :: $parser->setDefaults(array('verbose' => true)); $parser->addOption(...); list($values, $args) = $parser->parseArgs(); As before, the last value specified for a given option destination is the one that counts. For clarity, try to use one method or the other of setting default values, not both. Generating help =============== There is one more feature that you will use in every script: *Horde_Argv*'s ability to generate help messages. All you have to do is supply a help value for each option. Let's create a new parser and populate it with user-friendly (documented) options: :: $usage = 'usage: %prog [options] arg1 arg2'; $parser = new Horde_Argv_Parser(array('usage' => $usage)); $parser->addOption( '-v', '--verbose', array('action' => 'store_true', 'dest' => 'verbose', $default => 1, 'help' => 'make lots of noise [default]') ); $parser->addOption( '-q', '--quiet', array('action' => 'store_false', 'dest' => 'verbose', 'help' => 'be vewwy quiet (I'm hunting wabbits)') ); $parser->addOption( '-f', '--filename', array('metavar' => 'FILE', 'help' => 'write output to FILE') ); $parser->addOption( '-m', '--mode', array('default' => 'intermediate', 'help' => 'interaction mode: one of "novice", "intermediate" [default], "expert"') ); If *Horde_Argv* encounters either '-h' or '--help' on the command-line, or if you just call ``$parser->printHelp()``, it prints the following to stdout: :: usage: [options] arg1 arg2 options: -h, --help show this help message and exit -v, --verbose make lots of noise [default] -q, --quiet be vewwy quiet (I'm hunting wabbits) -fFILE, --filename=FILE write output to FILE -mMODE, --mode=MODE interaction mode: one of 'novice', 'intermediate' [default], 'expert' There's a lot going on here to help *Horde_Argv* generate the best possible help message: * the script defines its own usage message: ``$usage = 'usage: %prog [options] arg1 arg2';`` *Horde_Argv* expands "%prog" in the usage string to the name of the current script, i.e. basename($_SERVER['argv'][0]). The expanded string is then printed before the detailed option help. If you don't supply a usage string, *Horde_Argv* uses a bland but sensible default: "usage: %prog [options]", which is fine if your script doesn't take any positional arguments. * every option defines a help string, and doesn't worry about line-wrapping -- *Horde_Argv* takes care of wrapping lines and making the help output look good. * options that take a value indicate this fact in their automatically-generated help message, e.g. for the "mode" option: ``-mMODE, --mode=MODE`` Here, "MODE" is called the meta-variable: it stands for the argument that the user is expected to supply to -m/--mode. By default, *Horde_Argv* converts the destination variable name to uppercase and uses that for the meta-variable. Sometimes, that's not what you want -- for example, the --filename option explicitly sets $metavar = "FILE", resulting in this automatically-generated option description: ``-fFILE, --filename=FILE`` This is important for more than just saving space, though: the manually written help text uses the meta-variable "FILE", to clue the user in that there's a connection between the formal syntax "-fFILE" and the informal semantic description "write output to FILE". This is a simple but effective way to make your help text a lot clearer and more useful for end users. Print a version number ====================== Similar to the brief usage string, *Horde_Argv* can also print a version string for your program. You have to supply the string, as the version argument to ``Horde_Argv_Parser``: :: $parser = new Horde_Argv_Parser(array('usage' => '%prog [-f] [-q]', 'version' => '%prog 1.0')); Note that "%prog" is expanded just like it is in usage. Apart from that, version can contain anything you like. When you supply it, *Horde_Argv* automatically adds a "--version" option to your parser. If it encounters this option on the command line, it expands your version string (by replacing "%prog"), prints it to stdout, and exits. For example, if your script is called "/usr/bin/foo", a user might do: :: $ /usr/bin/foo --version foo 1.0 Error-handling ============== The one thing you need to know for basic usage is how *Horde_Argv* behaves when it encounters an error on the command-line -- e.g. "-n4x" where the "-n" option takes an integer. *Horde_Argv* prints your usage message to stderr, followed by a useful and human-readable error message. Then it terminates with a non-zero exit status by calling ``exit()``. If you don't like this, subclass ``Horde_Argv_Parser`` and override the ``parserError()`` method. See Extending *Horde_Argv*. Putting it all together ======================= Here's what a *Horde_Argv*-based scripts usually look like: :: require_once 'Horde/Autoloader/Default.php'; [...] $usage = 'usage: %prog [options] arg'; $parser = new Horde_Argv_Parser(array('usage' => $usage)); $parser->addOption( '-f', '--file', array('type' => 'string', 'dest' => 'filename', 'help' => 'read data from FILENAME') ); $parser->addOption( '-v', '--verbose', array('action' => 'store_true', 'dest' => 'verbose') ); $parser->addOption( '-q', '--quiet', array('action' => 'store_false', 'dest' => 'verbose') ); [... more options ...] list($values, $args) = $parser->parseArgs(); if (count($args) != 1) { $parser->parserError('incorrect number of arguments'); } if ($values->verbose) { printf('reading %s...%n', $values->filename); } [... go to work ...] Horde_Argv-2.1.0/doc/Horde/Argv/UPGRADING0000664000175000017500000000065213102315276015611 0ustar janjan====================== Upgrading Horde_Argv ====================== :Contact: dev@lists.horde.org .. contents:: Contents .. section-numbering:: This lists the API changes between releases of the package. Upgrading to 2.1.0 ================== - Horde_Argv_HelpFormatter - highlightHeading(), highlightOption() These methods have been added. - __construct() The $color parameter has been added. Horde_Argv-2.1.0/lib/Horde/Argv/AmbiguousOptionException.php0000664000175000017500000000221513102315276022060 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv */ /** * Raised if an ambiguous option is seen on the command line. * * @category Horde * @package Argv * @author Chuck Hagenbuch * @author Mike Naberezny * @copyright 2010-2017 Horde LLC * @license http://www.horde.org/licenses/bsd BSD */ class Horde_Argv_AmbiguousOptionException extends Horde_Argv_BadOptionException { public function __construct($opt_str, $possibilities) { // Have to skip the BadOptionException constructor or the string gets double-prefixed. Horde_Argv_OptionException::__construct(sprintf('ambiguous option: %s (%s?)', $opt_str, implode(', ', $possibilities))); } } Horde_Argv-2.1.0/lib/Horde/Argv/BadOptionException.php0000664000175000017500000000173013102315276020614 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv */ /** * Raised if an invalid option is seen on the command line. * * @category Horde * @package Argv * @author Chuck Hagenbuch * @author Mike Naberezny * @copyright 2010-2017 Horde LLC * @license http://www.horde.org/licenses/bsd BSD */ class Horde_Argv_BadOptionException extends Horde_Argv_OptionException { public function __construct($opt_str) { parent::__construct(sprintf('no such option: %s', $opt_str)); } } Horde_Argv-2.1.0/lib/Horde/Argv/Exception.php0000664000175000017500000000150413102315276017013 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv */ /** * Exception handler for the Horde_Argv library. * * @category Horde * @package Argv * @author Chuck Hagenbuch * @author Mike Naberezny * @copyright 2010-2017 Horde LLC * @license http://www.horde.org/licenses/bsd BSD */ class Horde_Argv_Exception extends Horde_Exception_Wrapped { } Horde_Argv-2.1.0/lib/Horde/Argv/HelpFormatter.php0000664000175000017500000002470213102315276017636 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv */ /** * Provides HelpFormatter, used by Horde_Argv_Parser to generate formatted * help text. * * Abstract base class for formatting option help. Horde_Argv_Parser * instances should use one of the HelpFormatter subclasses for * formatting help; by default IndentedHelpFormatter is used. * * Instance attributes: * parser : Horde_Argv_Parser * the controlling Horde_Argv_Parser instance * _color : Horde_Cli_Color @since Horde_Argv 2.1.0 * a color formatter * indent_increment : int * the number of columns to indent per nesting level * max_help_position : int * the maximum starting column for option help text * help_position : int * the calculated starting column for option help text; * initially the same as the maximum * width : int * total number of columns for output (automatically detected by default) * level : int * current indentation level * current_indent : int * current indentation level (in columns) * help_width : int * number of columns available for option help text (calculated) * default_tag : str * text to replace with each option's default value, "%default" * by default. Set to false value to disable default value expansion. * option_strings : { Option : str } * maps Option instances to the snippet of help text explaining * the syntax of that option, e.g. "-h, --help" or * "-fFILE, --file=FILE" * _short_opt_fmt : str * format string controlling how short options with values are * printed in help text. Must be either "%s%s" ("-fFILE") or * "%s %s" ("-f FILE"), because those are the two syntaxes that * Horde_Argv supports. * _long_opt_fmt : str * similar but for long options; must be either "%s %s" ("--file FILE") * or "%s=%s" ("--file=FILE"). * * @category Horde * @package Argv * @author Chuck Hagenbuch * @author Mike Naberezny * @copyright 2010-2017 Horde LLC * @license http://www.horde.org/licenses/bsd BSD */ abstract class Horde_Argv_HelpFormatter { const NO_DEFAULT_VALUE = 'none'; public $parser = null; public function __construct( $indent_increment, $max_help_position, $width = null, $short_first = false, $color = null ) { if (is_null($color)) { $color = new Horde_Cli_Color(); } $this->_color = $color; $this->indent_increment = $indent_increment; $this->help_position = $this->max_help_position = $max_help_position; if (is_null($width)) { $cli = new Horde_Cli(); $width = $cli->getWidth() - 2; } $this->width = $width; $this->current_indent = 0; $this->level = 0; $this->help_width = null; // computed later $this->short_first = $short_first; $this->default_tag = '%default'; $this->option_strings = array(); $this->_short_opt_fmt = '%s %s'; $this->_long_opt_fmt = '%s=%s'; } public function setParser($parser) { $this->parser = $parser; } public function setShortOptDelimiter($delim) { if (!in_array($delim, array('', ' '))) { throw new InvalidArgumentException('invalid metavar delimiter for short options: ' . $delim); } $this->_short_opt_fmt = "%s$delim%s"; } public function setLongOptDelimiter($delim) { if (!in_array($delim, array('=', ' '))) { throw new InvalidArgumentException('invalid metavar delimiter for long options: ' . $delim); } $this->_long_opt_fmt = "%s$delim%s"; } public function indent() { $this->current_indent += $this->indent_increment; $this->level += 1; } public function dedent() { $this->current_indent -= $this->indent_increment; assert($this->current_indent >= 0); // Indent decreased below 0 $this->level -= 1; } abstract public function formatUsage($usage); abstract public function formatHeading($heading); /** * Highlights with the heading color. * * @since Horde_Argv 2.1.0 * * @param string $heading A heading text. * * @retun string The colored text. */ public function highlightHeading($heading) { return $this->_color->brown($heading); } /** * Format a paragraph of free-form text for inclusion in the * help output at the current indentation level. */ protected function _formatText($text) { $text_width = $this->width - $this->current_indent; $indent = str_repeat(' ', $this->current_indent); return wordwrap($indent . $text, $text_width, "\n" . $indent, true); } public function formatDescription($description) { if ($description) { return $this->_formatText($description) . "\n"; } else { return ''; } } public function formatEpilog($epilog) { if ($epilog) { return "\n" . $this->_formatText($epilog) . "\n"; } else { return ''; } } public function expandDefault($option) { if (is_null($this->parser) || !$this->default_tag) { return $option->help; } $default_value = isset($this->parser->defaults[$option->dest]) ? $this->parser->defaults[$option->dest] : null; if ($default_value == Horde_Argv_Option::$NO_DEFAULT || !$default_value) { $default_value = self::NO_DEFAULT_VALUE; } return str_replace($this->default_tag, (string)$default_value, $option->help); } /** * The help for each option consists of two parts: * * the opt strings and metavars * eg. ("-x", or "-fFILENAME, --file=FILENAME") * * the user-supplied help string * eg. ("turn on expert mode", "read data from FILENAME") * * If possible, we write both of these on the same line: * -x turn on expert mode * * But if the opt string list is too long, we put the help * string on a second line, indented to the same column it would * start in if it fit on the first line. * -fFILENAME, --file=FILENAME * read data from FILENAME */ public function formatOption($option) { $result = array(); $opts = isset($this->option_strings[(string)$option]) ? $this->option_strings[(string)$option] : null; $opt_width = $this->help_position - $this->current_indent - 2; if (strlen($opts) > $opt_width) { $opts = sprintf( '%' . $this->current_indent . "s%s\n", '', $opts ); $indent_first = $this->help_position; } else { // start help on same line as opts $opts = sprintf( '%' . $this->current_indent . 's%-' . $opt_width . 's ', '', $opts ); $indent_first = 0; } $opts = $this->highlightOption($opts); $result[] = $opts; if ($option->help) { $help_text = $this->expandDefault($option); $help_lines = explode("\n", wordwrap($help_text, $this->help_width, "\n", true)); $result[] = sprintf( '%' . $indent_first . "s%s\n", '', $help_lines[0] ); for ($i = 1, $i_max = count($help_lines); $i < $i_max; $i++) { $result[] = sprintf( '%' . $this->help_position . "s%s\n", '', $help_lines[$i] ); } } elseif (substr($opts, -1) != "\n") { $result[] = "\n"; } return implode('', $result); } /** * Highlights with the option color. * * @since Horde_Argv 2.1.0 * * @param string $option An option text. * * @retun string The colored text. */ public function highlightOption($option) { return $this->_color->green($option); } public function storeOptionStrings($parser) { $this->indent(); $max_len = 0; foreach ($parser->optionList as $opt) { $strings = $this->formatOptionStrings($opt); $this->option_strings[(string)$opt] = $strings; $max_len = max( $max_len, strlen($strings) + $this->current_indent ); } $this->indent(); foreach ($parser->optionGroups as $group) { foreach ($group->optionList as $opt) { $strings = $this->formatOptionStrings($opt); $this->option_strings[(string)$opt] = $strings; $max_len = max( $max_len, strlen($strings) + $this->current_indent ); } } $this->dedent(); $this->dedent(); $this->help_position = min($max_len + 2, $this->max_help_position); $this->help_width = $this->width - $this->help_position; } /** * Return a comma-separated list of option strings & metavariables. */ public function formatOptionStrings($option) { if ($option->takesValue()) { $metavar = $option->metavar ? $option->metavar : Horde_String::upper($option->dest); $short_opts = array(); foreach ($option->shortOpts as $sopt) { $short_opts[] = sprintf($this->_short_opt_fmt, $sopt, $metavar); } $long_opts = array(); foreach ($option->longOpts as $lopt) { $long_opts[] = sprintf($this->_long_opt_fmt, $lopt, $metavar); } } else { $short_opts = $option->shortOpts; $long_opts = $option->longOpts; } if ($this->short_first) { $opts = array_merge($short_opts, $long_opts); } else { $opts = array_merge($long_opts, $short_opts); } return implode(', ', $opts); } } Horde_Argv-2.1.0/lib/Horde/Argv/IndentedHelpFormatter.php0000664000175000017500000000276013102315276021311 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv */ /** * Format help with indented section bodies. * * @category Horde * @package Argv * @author Chuck Hagenbuch * @author Mike Naberezny * @copyright 2010-2017 Horde LLC * @license http://www.horde.org/licenses/bsd BSD */ class Horde_Argv_IndentedHelpFormatter extends Horde_Argv_HelpFormatter { public function __construct( $indent_increment = 2, $max_help_position = 24, $width = null, $short_first = true, $color = null ) { parent::__construct( $indent_increment, $max_help_position, $width, $short_first, $color ); } public function formatUsage($usage) { return sprintf( $this->highlightHeading(Horde_Argv_Translation::t("Usage:")) . " %s\n", $usage ); } public function formatHeading($heading) { return $this->highlightHeading(sprintf( '%' . $this->current_indent . "s%s:\n", '', $heading )); } } Horde_Argv-2.1.0/lib/Horde/Argv/Option.php0000664000175000017500000004656713102315276016347 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv */ /** * Defines the Option class and some standard value-checking functions. * * Instance attributes: * shortOpts : [string] * longOpts : [string] * * action : string * type : string * dest : string * default : any * nargs : int * const : any * choices : [string] * callback : function * callbackArgs : (any*) * help : string * metavar : string * * @category Horde * @package Argv * @author Chuck Hagenbuch * @author Mike Naberezny * @copyright 2010-2017 Horde LLC * @license http://www.horde.org/licenses/bsd BSD */ class Horde_Argv_Option { const SUPPRESS_HELP = 'SUPPRESS HELP'; const SUPPRESS_USAGE = 'SUPPRESS USAGE'; /** * Not supplying a default is different from a default of None, * so we need an explicit 'not supplied' value. */ public static $NO_DEFAULT = array('NO', 'DEFAULT'); public static function parseNumber($value) { if (!strlen($value)) { return false; } // Values to check against or compute with. $first = substr($value, 0, 1); $prefix = substr($value, 0, 2); $suffix = substr($value, 2); // Hex if ($prefix == '0x' || $prefix == '0X') { if (strspn($suffix, '0123456789abcdefABCDEF') != strlen($suffix)) { return false; } return hexdec($value); } // Binary if ($prefix == '0b' || $prefix == '0B') { if (strspn($suffix, '01') != strlen($suffix)) { return false; } return bindec($value); } // Octal if ($first == '0') { $suffix = substr($value, 1); if (strspn($suffix, '01234567') != strlen($suffix)) { return false; } return octdec($suffix); } // Base 10 if (!is_numeric($value)) { return false; } return intval($value); } public function checkBuiltin($opt, $value) { switch ($this->type) { case 'int': case 'long': $number = self::parseNumber($value); if ($number === false) { $message = $this->type == 'int' ? Horde_Argv_Translation::t("option %s: invalid integer value: '%s'") : Horde_Argv_Translation::t("option %s: invalid long integer value: '%s'"); throw new Horde_Argv_OptionValueException( sprintf($message, $opt, $value)); } return $number; case 'float': if (!is_numeric($value)) { throw new Horde_Argv_OptionValueException( sprintf(Horde_Argv_Translation::t("option %s: invalid floating-point value: '%s'"), $opt, $value)); } return floatval($value); } } public function checkChoice($opt, $value) { if (in_array($value, $this->choices)) { return $value; } else { $choices = array(); foreach ($this->choices as $choice) { $choices[] = (string)$choice; } $choices = "'" . implode("', '", $choices) . "'"; throw new Horde_Argv_OptionValueException(sprintf( Horde_Argv_Translation::t("option %s: invalid choice: '%s' (choose from %s)"), $opt, $value, $choices)); } } /** * The list of instance attributes that may be set through keyword args to * the constructor. */ public $ATTRS = array( 'action', 'type', 'dest', 'default', 'nargs', 'const', 'choices', 'callback', 'callbackArgs', 'help', 'metavar', ); /** * The set of actions allowed by option parsers. Explicitly listed here so * the constructor can validate its arguments. */ public $ACTIONS = array( 'store', 'store_const', 'store_true', 'store_false', 'append', 'append_const', 'count', 'callback', 'help', 'version', ); /** * The set of actions that involve storing a value somewhere; * also listed just for constructor argument validation. (If * the action is one of these, there must be a destination.) */ public $STORE_ACTIONS = array( 'store', 'store_const', 'store_true', 'store_false', 'append', 'append_const', 'count', ); /** * The set of actions for which it makes sense to supply a value type, * ie. which may consume an argument from the command line. */ public $TYPED_ACTIONS = array( 'store', 'append', 'callback', ); /** * The set of actions which *require* a value type, ie. that always consume * an argument from the command line. */ public $ALWAYS_TYPED_ACTIONS = array('store', 'append'); /** * The set of actions which take a 'const' attribute. */ public $CONST_ACTIONS = array('store_const', 'append_const'); /** * The set of known types for option parsers. * * Again, listed here for constructor argument validation. */ public $TYPES = array('string', 'int', 'long', 'float', 'complex', 'choice'); /** * Dictionary of argument checking functions, which convert and validate * option arguments according to the option type. * * Signature of checking functions is: * * * mixed function(Horde_Argv_Option $option, string $opt, string $value) * * * where * - $option is the Horde_Argv_Option instance calling the checker * - $opt is the actual option seen on the command-line (eg. '-a', '--file') * - $value is the option argument seen on the command-line * * The return value should be in the appropriate PHP type * for $option->type -- eg. an integer if $option->type == 'int'. * * If no checker is defined for a type, arguments will be unchecked and * remain strings. */ public $TYPE_CHECKER = array('int' => 'checkBuiltin', 'long' => 'checkBuiltin', 'float' => 'checkBuiltin', 'complex' => 'checkBuiltin', 'choice' => 'checkChoice', ); /** * A list of unbound method objects. * * They are called by the constructor, in order, after all attributes are * initialized. The list is created and filled in later, after all the * methods are actually defined. (I just put it here because I like to * define and document all class attributes in the same place.) Subclasses * that add another _check_*() method should define their own CHECK_METHODS * list that adds their check method to those from this class. */ public $CHECK_METHODS = array('_checkAction', '_checkType', '_checkChoice', '_checkDest', '_checkConst', '_checkNargs', '_checkCallback', ); // -- Constructor/initialization methods ---------------------------- public $shortOpts = array(); public $longOpts = array(); public $dest; public $default; /** * Constructor. */ public function __construct() { // The last argument to this function is an $attrs hash, if it // is present and an array. All other arguments are $opts. $opts = func_get_args(); $num = func_num_args(); if ($num == 0 || $num == 1 || !is_array($opts[$num - 1])) { $attrs = array(); } else { $attrs = array_pop($opts); } // Set shortOpts, longOpts attrs from 'opts' tuple. // Have to be set now, in case no option strings are supplied. $this->shortOpts = array(); $this->longOpts = array(); $opts = $this->_checkOptStrings($opts); $this->_setOptStrings($opts); // Set all other attrs (action, type, etc.) from 'attrs' dict $this->_setAttrs($attrs); // Check all the attributes we just set. There are lots of // complicated interdependencies, but luckily they can be farmed // out to the _check*() methods listed in CHECK_METHODS -- which // could be handy for subclasses! The one thing these all share // is that they raise OptionError if they discover a problem. foreach ($this->CHECK_METHODS as $checker) { call_user_func(array($this, $checker)); } } protected function _checkOptStrings($opts) { // Filter out None because early versions of Optik had exactly // one short option and one long option, either of which // could be None. $opts = array_filter($opts); if (!$opts) { throw new InvalidArgumentException('at least one option string must be supplied'); } return $opts; } protected function _setOptStrings($opts) { foreach ($opts as &$opt) { $opt = (string)$opt; if (strlen($opt) < 2) { throw new Horde_Argv_OptionException(sprintf("invalid option string '%s': must be at least two characters long", $opt), $this); } elseif (strlen($opt) == 2) { if (!($opt[0] == '-' && $opt[1] != '-')) { throw new Horde_Argv_OptionException(sprintf( "invalid short option string '%s': " . "must be of the form -x, (x any non-dash char)", $opt), $this); } $this->shortOpts[] = $opt; } else { if (!(substr($opt, 0, 2) == '--' && $opt[2] != '-')) { throw new Horde_Argv_OptionException(sprintf( "invalid long option string '%s': " . "must start with --, followed by non-dash", $opt), $this); } $this->longOpts[] = $opt; } } } protected function _setAttrs($attrs) { foreach ($this->ATTRS as $attr) { if (array_key_exists($attr, $attrs)) { $this->$attr = $attrs[$attr]; unset($attrs[$attr]); } else { if ($attr == 'default') { $this->$attr = self::$NO_DEFAULT; } else { $this->$attr = null; } } } if ($attrs) { $attrs = array_keys($attrs); sort($attrs); throw new Horde_Argv_OptionException(sprintf( 'invalid keyword arguments: %s', implode(', ', $attrs)), $this); } } // -- Constructor validation methods -------------------------------- public function _checkAction() { if (is_null($this->action)) { $this->action = 'store'; } elseif (!in_array($this->action, $this->ACTIONS)) { throw new Horde_Argv_OptionException(sprintf("invalid action: '%s'", $this->action), $this); } } public function _checkType() { if (is_null($this->type)) { if (in_array($this->action, $this->ALWAYS_TYPED_ACTIONS)) { if (!is_null($this->choices)) { // The 'choices' attribute implies 'choice' type. $this->type = 'choice'; } else { // No type given? 'string' is the most sensible default. $this->type = 'string'; } } } else { if ($this->type == 'str') { $this->type = 'string'; } if (!in_array($this->type, $this->TYPES)) { throw new Horde_Argv_OptionException(sprintf("invalid option type: '%s'", $this->type), $this); } if (!in_array($this->action, $this->TYPED_ACTIONS)) { throw new Horde_Argv_OptionException(sprintf( "must not supply a type for action '%s'", $this->action), $this); } } } public function _checkChoice() { if ($this->type == 'choice') { if (is_null($this->choices)) { throw new Horde_Argv_OptionException( "must supply a list of choices for type 'choice'", $this); } elseif (!(is_array($this->choices) || $this->choices instanceof Iterator)) { throw new Horde_Argv_OptionException(sprintf( "choices must be a list of strings ('%s' supplied)", gettype($this->choices)), $this); } } elseif (!is_null($this->choices)) { throw new Horde_Argv_OptionException(sprintf( "must not supply choices for type '%s'", $this->type), $this); } } public function _checkDest() { // No destination given, and we need one for this action. The // $this->type check is for callbacks that take a value. $takes_value = (in_array($this->action, $this->STORE_ACTIONS) || !is_null($this->type)); if (is_null($this->dest) && $takes_value) { // Glean a destination from the first long option string, // or from the first short option string if no long options. if ($this->longOpts) { // eg. '--foo-bar' -> 'foo_bar' $this->dest = str_replace('-', '_', substr($this->longOpts[0], 2)); } else { $this->dest = $this->shortOpts[0][1]; } } } public function _checkConst() { if (!in_array($this->action, $this->CONST_ACTIONS) && !is_null($this->const)) { throw new Horde_Argv_OptionException(sprintf( "'const' must not be supplied for action '%s'", $this->action), $this); } } public function _checkNargs() { if (in_array($this->action, $this->TYPED_ACTIONS)) { if (is_null($this->nargs)) { $this->nargs = 1; } } elseif (!is_null($this->nargs)) { throw new Horde_Argv_OptionException(sprintf( "'nargs' must not be supplied for action '%s'", $this->action), $this); } } public function _checkCallback() { if ($this->action == 'callback') { if (!is_callable($this->callback)) { $callback_name = is_array($this->callback) ? is_object($this->callback[0]) ? get_class($this->callback[0] . '#' . $this->callback[1]) : implode('#', $this->callback) : $this->callback; throw new Horde_Argv_OptionException(sprintf( "callback not callable: '%s'", $callback_name), $this); } if (!is_null($this->callbackArgs) && !is_array($this->callbackArgs)) { throw new Horde_Argv_OptionException(sprintf( "callbackArgs, if supplied, must be an array: not '%s'", $this->callbackArgs), $this); } } else { if (!is_null($this->callback)) { $callback_name = is_array($this->callback) ? is_object($this->callback[0]) ? get_class($this->callback[0] . '#' . $this->callback[1]) : implode('#', $this->callback) : $this->callback; throw new Horde_Argv_OptionException(sprintf( "callback supplied ('%s') for non-callback option", $callback_name), $this); } if (!is_null($this->callbackArgs)) { throw new Horde_Argv_OptionException( 'callbackArgs supplied for non-callback option', $this); } } } // -- Miscellaneous methods ----------------------------------------- public function __toString() { return implode('/', array_merge($this->shortOpts, $this->longOpts)); } public function takesValue() { return !is_null($this->type); } public function hasDefault() { return $this->default !== self::$NO_DEFAULT; } public function getOptString() { if ($this->longOpts) { return $this->longOpts[0]; } else { return $this->shortOpts[0]; } } // -- Processing methods -------------------------------------------- public function checkValue($opt, $value) { if (!isset($this->TYPE_CHECKER[$this->type])) { return $value; } $checker = $this->TYPE_CHECKER[$this->type]; return call_user_func(array($this, $checker), $opt, $value); } public function convertValue($opt, $value) { if (!is_null($value)) { if ($this->nargs == 1) { return $this->checkValue($opt, $value); } else { $return = array(); foreach ($value as $v) { $return[] = $this->checkValue($opt, $v); } return $return; } } } public function process($opt, $value, $values, $parser) { // First, convert the value(s) to the right type. Howl if any // value(s) are bogus. $value = $this->convertValue($opt, $value); // And then take whatever action is expected of us. // This is a separate method to make life easier for // subclasses to add new actions. return $this->takeAction( $this->action, $this->dest, $opt, $value, $values, $parser); } public function takeAction($action, $dest, $opt, $value, $values, $parser) { if ($action == 'store') { $values->$dest = $value; } elseif ($action == 'store_const') { $values->$dest = $this->const; } elseif ($action == 'store_true') { $values->$dest = true; } elseif ($action == 'store_false') { $values->$dest = false; } elseif ($action == 'append') { $values->{$dest}[] = $value; } elseif ($action == 'append_const') { $values->{$dest}[] = $this->const; } elseif ($action == 'count') { $values->ensureValue($dest, 0); $values->$dest++; } elseif ($action == 'callback') { call_user_func($this->callback, $this, $opt, $value, $parser, $this->callbackArgs); } elseif ($action == 'help') { $parser->printHelp(); $parser->parserExit(); } elseif ($action == 'version') { $parser->printVersion(); $parser->parserExit(); } else { throw new RuntimeException('unknown action ' . $this->action); } return 1; } } Horde_Argv-2.1.0/lib/Horde/Argv/OptionConflictException.php0000664000175000017500000000154613102315276021674 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv */ /** * Raised if conflicting options are added to a Horde_Argv_Parser. * * @category Horde * @package Argv * @author Chuck Hagenbuch * @author Mike Naberezny * @copyright 2010-2017 Horde LLC * @license http://www.horde.org/licenses/bsd BSD */ class Horde_Argv_OptionConflictException extends Horde_Argv_OptionException {} Horde_Argv-2.1.0/lib/Horde/Argv/OptionContainer.php0000664000175000017500000002210613102315276020171 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv */ /** * Abstract base class. * * Class attributes: * standardOptionList : [Option] * list of standard options that will be accepted by all instances * of this parser class (intended to be overridden by subclasses). * * Instance attributes: * optionList : [Option] * the list of Option objects contained by this OptionContainer * shortOpt : { string : Option } * dictionary mapping short option strings, eg. "-f" or "-X", * to the Option instances that implement them. If an Option * has multiple short option strings, it will appears in this * dictionary multiple times. [1] * longOpt : { string : Option } * dictionary mapping long option strings, eg. "--file" or * "--exclude", to the Option instances that implement them. * Again, a given Option can occur multiple times in this * dictionary. [1] * defaults : { string : any } * dictionary mapping option destination names to default * values for each destination [1] * * [1] These mappings are common to (shared by) all components of the * controlling Horde_Argv_Parser, where they are initially created. * * @category Horde * @package Argv * @author Chuck Hagenbuch * @author Mike Naberezny * @copyright 2010-2017 Horde LLC * @license http://www.horde.org/licenses/bsd BSD */ class Horde_Argv_OptionContainer { public $description = ''; public $optionList = array(); public $optionClass = 'Horde_Argv_Option'; public $defaults = array(); public $shortOpt = array(); public $longOpt = array(); public $conflictHandler; /** * Initialize the option list and related data structures. * This method must be provided by subclasses, and it must * initialize at least the following instance attributes: * optionList, shortOpt, longOpt, defaults. */ public function __construct($optionClass, $conflictHandler, $description) { $this->_createOptionList(); $this->optionClass = $optionClass; $this->setConflictHandler($conflictHandler); $this->setDescription($description); } /** * For use by Horde_Argv_Parser constructor -- create the master * option mappings used by this Horde_Argv_Parser and all * OptionGroups that it owns. */ protected function _createOptionMappings() { $this->shortOpt = array(); // single letter -> Option instance $this->longOpt = array(); // long option -> Option instance $this->defaults = array(); // maps option dest -> default value } /** * For use by OptionGroup constructor -- use shared option * mappings from the Horde_Argv_Parser that owns this OptionGroup. */ protected function _shareOptionMappings($parser) { $this->shortOpt =& $parser->shortOpt; $this->longOpt =& $parser->longOpt; $this->defaults = $parser->defaults; } public function setConflictHandler($handler) { if (!in_array($handler, array('error', 'resolve'))) { throw new InvalidArgumentException('invalid conflictHandler ' . var_export($handler, true)); } $this->conflictHandler = $handler; } public function setDescription($description) { $this->description = $description; } public function getDescription() { return $this->description; } // -- Option-adding methods ----------------------------------------- protected function _checkConflict($option) { $conflictOpts = array(); foreach ($option->shortOpts as $opt) { if (isset($this->shortOpt[$opt])) { $conflictOpts[$opt] = $this->shortOpt[$opt]; } } foreach ($option->longOpts as $opt) { if (isset($this->longOpt[$opt])) { $conflictOpts[$opt] = $this->longOpt[$opt]; } } if ($conflictOpts) { $handler = $this->conflictHandler; if ($handler == 'error') { throw new Horde_Argv_OptionConflictException(sprintf( 'conflicting option string(s): %s', implode(', ', array_keys($conflictOpts))), $option); } elseif ($handler == 'resolve') { foreach ($conflictOpts as $opt => $c_option) { if (strncmp($opt, '--', 2) === 0) { $key = array_search($opt, $c_option->longOpts); if ($key !== false) { unset($c_option->longOpts[$key]); } unset($this->longOpt[$opt]); } else { $key = array_search($opt, $c_option->shortOpts); if ($key !== false) { unset($c_option->shortOpts[$key]); } unset($this->shortOpt[$opt]); } if (! ($c_option->shortOpts || $c_option->longOpts)) { $key = array_search($c_option, $c_option->container->optionList); unset($c_option->container->optionList[$key]); } } } } } public function addOption() { $opts = func_get_args(); if (count($opts) && is_string($opts[0])) { $optionFactory = new ReflectionClass($this->optionClass); $option = $optionFactory->newInstanceArgs($opts); } elseif (count($opts) == 1) { $option = $opts[0]; if (!$option instanceof Horde_Argv_Option) throw new InvalidArgumentException('not an Option instance: ' . var_export($option, true)); } else { throw new InvalidArgumentException('invalid arguments'); } $this->_checkConflict($option); $this->optionList[] = $option; $option->container = $this; foreach ($option->shortOpts as $opt) { $this->shortOpt[$opt] = $option; } foreach ($option->longOpts as $opt) { $this->longOpt[$opt] = $option; } if (!is_null($option->dest)) { // option has a dest, we need a default if ($option->default !== Horde_Argv_Option::$NO_DEFAULT) { $this->defaults[$option->dest] = $option->default; } elseif (!isset($this->defaults[$option->dest])) { $this->defaults[$option->dest] = null; } } return $option; } public function addOptions($optionList) { foreach ($optionList as $option) { $this->addOption($option); } } // -- Option query/removal methods ---------------------------------- public function getOption($opt_str) { if (isset($this->shortOpt[$opt_str])) { return $this->shortOpt[$opt_str]; } elseif (isset($this->longOpt[$opt_str])) { return $this->longOpt[$opt_str]; } else { return null; } } public function hasOption($opt_str) { return isset($this->shortOpt[$opt_str]) || isset($this->longOpt[$opt_str]); } public function removeOption($opt_str) { $option = $this->getOption($opt_str); if (is_null($option)) { throw new InvalidArgumentException("no such option '$opt_str'"); } foreach ($option->shortOpts as $opt) { unset($this->shortOpt[$opt]); } foreach ($option->longOpts as $opt) { unset($this->longOpt[$opt]); } $key = array_search($option, $option->container->optionList); unset($option->container->optionList[$key]); } // -- Help-formatting methods --------------------------------------- public function formatOptionHelp($formatter = null) { if (!$this->optionList) return ''; $result = array(); foreach ($this->optionList as $option) { if ($option->help != Horde_Argv_Option::SUPPRESS_HELP) $result[] = $formatter->formatOption($option); } return implode('', $result); } public function formatDescription($formatter = null) { return $formatter->formatDescription($this->getDescription()); } public function formatHelp($formatter = null) { $result = array(); if ($this->description) $result[] = $this->formatDescription($formatter); if ($this->optionList) $result[] = $this->formatOptionHelp($formatter); return implode("\n", $result); } } Horde_Argv-2.1.0/lib/Horde/Argv/OptionException.php0000664000175000017500000000221513102315276020204 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv */ /** * Raised if an Option instance is created with invalid or * inconsistent arguments. * * @category Horde * @package Argv * @author Chuck Hagenbuch * @author Mike Naberezny * @copyright 2010-2017 Horde LLC * @license http://www.horde.org/licenses/bsd BSD */ class Horde_Argv_OptionException extends Horde_Argv_Exception { public function __construct($msg, $option = null) { $this->optionId = (string)$option; if ($this->optionId) { parent::__construct(sprintf('option %s: %s', $this->optionId, $msg)); } else { parent::__construct($msg); } } } Horde_Argv-2.1.0/lib/Horde/Argv/OptionGroup.php0000664000175000017500000000347113102315276017347 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv */ /** * An option group allows to group a number of options under a common header * and description. * * @category Horde * @package Argv * @author Chuck Hagenbuch * @author Mike Naberezny * @copyright 2010-2017 Horde LLC * @license http://www.horde.org/licenses/bsd BSD */ class Horde_Argv_OptionGroup extends Horde_Argv_OptionContainer { protected $_title; public function __construct($parser, $title, $description = null) { $this->parser = $parser; parent::__construct($parser->optionClass, $parser->conflictHandler, $description); $this->_title = $title; } protected function _createOptionList() { $this->optionList = array(); $this->_shareOptionMappings($this->parser); } public function setTitle($title) { $this->_title = $title; } public function __destruct() { unset($this->optionList); } // -- Help-formatting methods --------------------------------------- public function formatHelp($formatter = null) { if (is_null($formatter)) return ''; $result = $formatter->formatHeading($this->_title); $formatter->indent(); $result .= parent::formatHelp($formatter); $formatter->dedent(); return $result; } } Horde_Argv-2.1.0/lib/Horde/Argv/OptionValueException.php0000664000175000017500000000154313102315276021204 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv */ /** * Raised if an invalid option value is encountered on the command * * @category Horde * @package Argv * @author Chuck Hagenbuch * @author Mike Naberezny * @copyright 2010-2017 Horde LLC * @license http://www.horde.org/licenses/bsd BSD */ class Horde_Argv_OptionValueException extends Horde_Argv_OptionException {} Horde_Argv-2.1.0/lib/Horde/Argv/Parser.php0000664000175000017500000005704113102315276016320 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv */ /** * Horde command-line argument parsing package. * * Class attributes: * standardOptionList : [Option] * list of standard options that will be accepted by all instances * of this parser class (intended to be overridden by subclasses). * * Instance attributes: * usage : string * a usage string for your program. Before it is displayed * to the user, "%prog" will be expanded to the name of * your program ($this->prog or os.path.basename(sys.argv[0])). * prog : string * the name of the current program (to override * os.path.basename(sys.argv[0])). * epilog : string * paragraph of help text to print after option help * * optionGroups : [OptionGroup] * list of option groups in this parser (option groups are * irrelevant for parsing the command-line, but very useful * for generating help) * * allowInterspersedArgs : bool = true * if true, positional arguments may be interspersed with options. * Assuming -a and -b each take a single argument, the command-line * -ablah foo bar -bboo baz * will be interpreted the same as * -ablah -bboo -- foo bar baz * If this flag were false, that command line would be interpreted as * -ablah -- foo bar -bboo baz * -- ie. we stop processing options as soon as we see the first * non-option argument. (This is the tradition followed by * Python's getopt module, Perl's Getopt::Std, and other argument- * parsing libraries, but it is generally annoying to users.) * * allowUnknownArgs : bool = false * if true, unrecognized arguments will be auto-created, instead * of throwing a BadOptionException. * * ignoreUnknownArgs : bool = false * if true, unrecognized arguments will be silently skipped, instead of * throwing a BadOptionException. * * rargs : [string] * the argument list currently being parsed. Only set when * parseArgs() is active, and continually trimmed down as * we consume arguments. Mainly there for the benefit of * callback options. * largs : [string] * the list of leftover arguments that we have skipped while * parsing options. If allowInterspersedArgs is false, this * list is always empty. * values : Values * the set of option values currently being accumulated. Only * set when parseArgs() is active. Also mainly for callbacks. * * @category Horde * @package Argv * @author Chuck Hagenbuch * @author Mike Naberezny * @copyright 2010-2017 Horde LLC * @license http://www.horde.org/licenses/bsd BSD */ class Horde_Argv_Parser extends Horde_Argv_OptionContainer { public $standardOptionList = array(); protected $_usage; public $optionGroups = array(); public function __construct($args = array()) { $args = array_merge(array( 'usage' => null, 'optionList' => null, 'optionClass' => 'Horde_Argv_Option', 'version' => null, 'conflictHandler' => "error", 'description' => null, 'formatter' => null, 'addHelpOption' => true, 'prog' => null, 'epilog' => null, 'allowInterspersedArgs' => true, 'allowUnknownArgs' => false, 'ignoreUnknownArgs' => false, ), $args); parent::__construct($args['optionClass'], $args['conflictHandler'], $args['description']); $this->setUsage($args['usage']); $this->prog = $args['prog']; $this->version = $args['version']; $this->allowInterspersedArgs = $args['allowInterspersedArgs']; $this->allowUnknownArgs = $args['allowUnknownArgs']; $this->ignoreUnknownArgs = $args['ignoreUnknownArgs']; if (is_null($args['formatter'])) { $args['formatter'] = new Horde_Argv_IndentedHelpFormatter(); } $this->formatter = $args['formatter']; $this->formatter->setParser($this); $this->epilog = $args['epilog']; // Populate the option list; initial sources are the // standardOptionList class attribute, the 'optionList' // argument, and (if applicable) the _addVersionOption() and // _addHelpOption() methods. $this->_populateOptionList($args['optionList'], $args['addHelpOption']); $this->_initParsingState(); } // -- Private methods ----------------------------------------------- // (used by our OptionContainer's constructor) protected function _createOptionList() { $this->optionList = array(); $this->optionGroups = array(); $this->_createOptionMappings(); } protected function _addHelpOption() { $this->addOption('-h', '--help', array('action' => 'help', 'help' => Horde_Argv_Translation::t("show this help message and exit"))); } protected function _addVersionOption() { $this->addOption('--version', array('action' => 'version', 'help' => Horde_Argv_Translation::t("show program's version number and exit"))); } protected function _populateOptionList($optionList, $add_help = true) { if ($this->standardOptionList) $this->addOptions($this->standardOptionList); if ($optionList) $this->addOptions($optionList); if ($this->version) $this->_addVersionOption(); if ($add_help) $this->_addHelpOption(); } protected function _initParsingState() { // These are set in parseArgs() for the convenience of callbacks. $this->rargs = null; $this->largs = null; $this->values = null; } // -- Simple modifier methods --------------------------------------- public function setUsage($usage) { if (is_null($usage)) $this->_usage = '%prog ' . Horde_Argv_Translation::t("[options]"); elseif ($usage == Horde_Argv_Option::SUPPRESS_USAGE) $this->_usage = null; else $this->_usage = $usage; } public function enableInterspersedArgs() { $this->allowInterspersedArgs = true; } public function disableInterspersedArgs() { $this->allowInterspersedArgs = false; } public function setDefault($dest, $value) { $this->defaults[$dest] = $value; } public function setDefaults($defaults) { $this->defaults = array_merge($this->defaults, $defaults); } protected function _getAllOptions() { $options = $this->optionList; foreach ($this->optionGroups as $group) { $options = array_merge($options, $group->optionList); } return $options; } public function getDefaultValues() { $defaults = $this->defaults; foreach ($this->_getAllOptions() as $option) { $default = isset($defaults[$option->dest]) ? $defaults[$option->dest] : null; if (is_string($default)) { $opt_str = $option->getOptString(); $defaults[$option->dest] = $option->checkValue($opt_str, $default); } } return new Horde_Argv_Values($defaults); } // -- OptionGroup methods ------------------------------------------- public function addOptionGroup() { // XXX lots of overlap with OptionContainer::addOption() $args = func_get_args(); if (count($args) && is_string($args[0])) { $groupFactory = new ReflectionClass('Horde_Argv_OptionGroup'); array_unshift($args, $this); $group = $groupFactory->newInstanceArgs($args); } elseif (count($args) == 1) { $group = $args[0]; if (!$group instanceof Horde_Argv_OptionGroup) throw new InvalidArgumentException("not an OptionGroup instance: " . var_export($group, true)); if ($group->parser !== $this) throw new InvalidArgumentException("invalid OptionGroup (wrong parser)"); } else { throw new InvalidArgumentException('invalid arguments'); } $this->optionGroups[] = $group; $this->defaults = array_merge($this->defaults, $group->defaults); return $group; } public function getOptionGroup($opt_str) { if (isset($this->shortOpt[$opt_str])) { $option = $this->shortOpt[$opt_str]; } elseif (isset($this->longOpt[$opt_str])) { $option = $this->longOpt[$opt_str]; } else { return null; } if ($option->container !== $this) { return $option->container; } return null; } // -- Option-parsing methods ---------------------------------------- protected function _getArgs($args = null) { if (is_null($args)) { $args = $_SERVER['argv']; array_shift($args); return $args; } else { return $args; } } /** * Parse the command-line options found in 'args' (default: * sys.argv[1:]). Any errors result in a call to 'parserError()', which * by default prints the usage message to stderr and calls * exit() with an error message. On success returns a pair * (values, args) where 'values' is an Values instance (with all * your option values) and 'args' is the list of arguments left * over after parsing options. */ public function parseArgs($args = null, $values = null) { $rargs = $this->_getArgs($args); $largs = array(); if (is_null($values)) $values = $this->getDefaultValues(); // Store the halves of the argument list as attributes for the // convenience of callbacks: // rargs // the rest of the command-line (the "r" stands for // "remaining" or "right-hand") // largs // the leftover arguments -- ie. what's left after removing // options and their arguments (the "l" stands for "leftover" // or "left-hand") $this->rargs =& $rargs; $this->largs =& $largs; $this->values = $values; try { $this->_processArgs($largs, $rargs, $values); } catch (Horde_Argv_BadOptionException $e) { $this->parserError($e->getMessage()); } catch (Horde_Argv_OptionValueException $e) { $this->parserError($e->getMessage()); } $args = array_merge($largs, $rargs); return $this->checkValues($values, $args); } /** * Check that the supplied option values and leftover arguments are * valid. Returns the option values and leftover arguments * (possibly adjusted, possibly completely new -- whatever you * like). Default implementation just returns the passed-in * values; subclasses may override as desired. */ public function checkValues($values, $args) { return array($values, $args); } /** * _process_args(largs : [string], * rargs : [string], * values : Values) * * Process command-line arguments and populate 'values', consuming * options and arguments from 'rargs'. If 'allowInterspersedArgs' is * false, stop at the first non-option argument. If true, accumulate any * interspersed non-option arguments in 'largs'. */ protected function _processArgs(&$largs, &$rargs, &$values) { while ($rargs) { $arg = $rargs[0]; // We handle bare "--" explicitly, and bare "-" is handled by the // standard arg handler since the short arg case ensures that the // len of the opt string is greater than 1. if ($arg == '--') { array_shift($rargs); return; } elseif (substr($arg, 0, 2) == '--') { // process a single long option (possibly with value(s)) $this->_processLongOpt($rargs, $values); } elseif (substr($arg, 0, 1) == '-' && strlen($arg) > 1) { // process a cluster of short options (possibly with // value(s) for the last one only) $this->_processShortOpts($rargs, $values); } elseif ($this->allowInterspersedArgs) { $largs[] = $arg; array_shift($rargs); } else { // stop now, leave this arg in rargs return; } } // Say this is the original argument list: // [arg0, arg1, ..., arg(i-1), arg(i), arg(i+1), ..., arg(N-1)] // ^ // (we are about to process arg(i)). // // Then rargs is [arg(i), ..., arg(N-1)] and largs is a *subset* of // [arg0, ..., arg(i-1)] (any options and their arguments will have // been removed from largs). // // The while loop will usually consume 1 or more arguments per pass. // If it consumes 1 (eg. arg is an option that takes no arguments), // then after _process_arg() is done the situation is: // // largs = subset of [arg0, ..., arg(i)] // rargs = [arg(i+1), ..., arg(N-1)] // // If allowInterspersedArgs is false, largs will always be // *empty* -- still a subset of [arg0, ..., arg(i-1)], but // not a very interesting subset! } /** * opt : string) -> string * * Determine which long option string 'opt' matches, ie. which one * it is an unambiguous abbrevation for. Raises BadOptionError if * 'opt' doesn't unambiguously match any long option string. */ protected function _matchLongOpt($opt) { return self::matchAbbrev($opt, $this->longOpt); } /** * (s : string, wordmap : {string : Option}) -> string * * Return the string key in 'wordmap' for which 's' is an unambiguous * abbreviation. If 's' is found to be ambiguous or doesn't match any of * 'words', raise BadOptionError. */ public static function matchAbbrev($s, $wordmap) { // Is there an exact match? if (array_key_exists($s, $wordmap)) { return $s; } // Isolate all words with s as a prefix. $possibilities = array(); foreach (array_keys($wordmap) as $word) { if (strncmp($word, $s, strlen($s)) === 0) { $possibilities[] = $word; } } // No exact match, so there had better be just one possibility. if (count($possibilities) == 1) { return $possibilities[0]; } elseif (!$possibilities) { throw new Horde_Argv_BadOptionException($s); } else { // More than one possible completion: ambiguous prefix. sort($possibilities); throw new Horde_Argv_AmbiguousOptionException($s, $possibilities); } } protected function _processLongOpt(&$rargs, &$values) { $arg = array_shift($rargs); // Value explicitly attached to arg? Pretend it's the next // argument. if (strpos($arg, '=') !== false) { list($opt, $next_arg) = explode('=', $arg, 2); array_unshift($rargs, $next_arg); $had_explicit_value = true; } else { $opt = $arg; $had_explicit_value = false; } try { $opt = $this->_matchLongOpt($opt); $option = $this->longOpt[$opt]; } catch (Horde_Argv_BadOptionException $e) { if ($this->ignoreUnknownArgs) { return; } if ($this->allowUnknownArgs) { $option = $this->addOption($opt, array('default' => true, 'action' => 'append')); } else { throw $e; } } if ($option->takesValue()) { $nargs = $option->nargs; if (count($rargs) < $nargs) { if (!$option->hasDefault()) { if ($nargs == 1) { $this->parserError(sprintf(Horde_Argv_Translation::t("%s option requires an argument"), $opt)); } else { $this->parserError(sprintf(Horde_Argv_Translation::t("%s option requires %d arguments"), $opt, $nargs)); } } } elseif ($nargs == 1) { $value = array_shift($rargs); } else { $value = array_splice($rargs, 0, $nargs); } } elseif ($had_explicit_value) { $this->parserError(sprintf(Horde_Argv_Translation::t("%s option does not take a value"), $opt)); } else { $value = null; } $option->process($opt, $value, $values, $this); } protected function _processShortOpts(&$rargs, &$values) { $arg = array_shift($rargs); $stop = false; $i = 1; for ($c = 1, $c_max = strlen($arg); $c < $c_max; $c++) { $ch = $arg[$c]; $opt = '-' . $ch; $option = isset($this->shortOpt[$opt]) ? $this->shortOpt[$opt] : null; $i++; // we have consumed a character if (!$option) { if ($this->allowUnknownArgs) { $option = $this->addOption($opt, array('default' => true, 'action' => 'append')); } else { throw new Horde_Argv_BadOptionException($opt); } } if ($option->takesValue()) { // Any characters left in arg? Pretend they're the // next arg, and stop consuming characters of arg. if ($i < strlen($arg)) { array_unshift($rargs, substr($arg, $i)); $stop = true; } $nargs = $option->nargs; if (count($rargs) < $nargs) { if (!$option->hasDefault()) { if ($nargs == 1) { $this->parserError(sprintf(Horde_Argv_Translation::t("%s option requires an argument"), $opt)); } else { $this->parserError(sprintf(Horde_Argv_Translation::t("%s option requires %d arguments"), $opt, $nargs)); } } } elseif ($nargs == 1) { $value = array_shift($rargs); } else { $value = array_splice($rargs, 0, $nargs); } } else { // option doesn't take a value $value = null; } $option->process($opt, $value, $values, $this); if ($stop) { break; } } } // -- Feedback methods ---------------------------------------------- public function getProgName() { if (is_null($this->prog)) return basename($_SERVER['argv'][0]); else return $this->prog; } public function expandProgName($s) { return str_replace("%prog", $this->getProgName(), $s); } public function getDescription() { return $this->expandProgName($this->description); } public function parserExit($status = 0, $msg = null) { if ($msg) fwrite(STDERR, $msg); exit($status); } /** * Print a usage message incorporating $msg to stderr and exit. * If you override this in a subclass, it should not return -- it * should either exit or raise an exception. * * @param string $msg */ public function parserError($msg) { $this->printUsage(STDERR); $this->parserExit(2, sprintf("%s: error: %s\n", $this->getProgName(), $msg)); } public function getUsage($formatter = null) { if (is_null($formatter)) $formatter = $this->formatter; if ($this->_usage) return $formatter->formatUsage($this->expandProgName($this->_usage)); else return ''; } /** * (file : file = stdout) * * Print the usage message for the current program ($this->_usage) to * 'file' (default stdout). Any occurence of the string "%prog" in * $this->_usage is replaced with the name of the current program * (basename of sys.argv[0]). Does nothing if $this->_usage is empty * or not defined. */ public function printUsage($file = null) { if (!$this->_usage) return; if (is_null($file)) echo $this->getUsage(); else fwrite($file, $this->getUsage()); } public function getVersion() { if ($this->version) return $this->expandProgName($this->version); else return ''; } /** * file : file = stdout * * Print the version message for this program ($this->version) to * 'file' (default stdout). As with printUsage(), any occurence * of "%prog" in $this->version is replaced by the current program's * name. Does nothing if $this->version is empty or undefined. */ public function printVersion($file = null) { if (!$this->version) return; if (is_null($file)) echo $this->getVersion() . "\n"; else fwrite($file, $this->getVersion() . "\n"); } public function formatOptionHelp($formatter = null) { if (is_null($formatter)) $formatter = $this->formatter; $formatter->storeOptionStrings($this); $result = array(); $result[] = $formatter->formatHeading(Horde_Argv_Translation::t("Options")); $formatter->indent(); if ($this->optionList) { $result[] = parent::formatOptionHelp($formatter); $result[] = "\n"; } foreach ($this->optionGroups as $group) { $result[] = $group->formatHelp($formatter); $result[] = "\n"; } $formatter->dedent(); // Drop the last "\n", or the header if no options or option groups: array_pop($result); return implode('', $result); } public function formatEpilog($formatter) { return $formatter->formatEpilog($this->epilog); } public function formatHelp($formatter = null) { if (is_null($formatter)) $formatter = $this->formatter; $result = array(); if ($this->_usage) $result[] = $this->getUsage($formatter) . "\n"; if ($this->description) $result[] = $this->formatDescription($formatter) . "\n"; $result[] = $this->formatOptionHelp($formatter); $result[] = $this->formatEpilog($formatter); return implode('', $result); } /** * file : file = stdout * * Print an extended help message, listing all options and any * help text provided with them, to 'file' (default stdout). */ public function printHelp($file = null) { if (is_null($file)) echo $this->formatHelp(); else fwrite($file, $this->formatHelp()); } } Horde_Argv-2.1.0/lib/Horde/Argv/TitledHelpFormatter.php0000664000175000017500000000307413102315276021003 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv */ /** * Format help with underlined section headers. * * @category Horde * @package Argv * @author Chuck Hagenbuch * @author Mike Naberezny * @copyright 2010-2017 Horde LLC * @license http://www.horde.org/licenses/bsd BSD */ class Horde_Argv_TitledHelpFormatter extends Horde_Argv_HelpFormatter { public function __construct( $indent_increment = 0, $max_help_position = 24, $width = null, $short_first = false, $color = null ) { parent::__construct( $indent_increment, $max_help_position, $width, $short_first, $color ); } public function formatUsage($usage) { return sprintf( "%s %s\n", $this->formatHeading(Horde_Argv_Translation::t("Usage")), $usage ); } public function formatHeading($heading) { $prefix = array('=', '-'); return $this->highlightHeading(sprintf( "%s\n%s\n", $heading, str_repeat($prefix[$this->level], strlen($heading)) )); } } Horde_Argv-2.1.0/lib/Horde/Argv/Translation.php0000664000175000017500000000171313102315276017355 0ustar janjan * @category Horde * @license http://www.horde.org/licenses/bsd BSD */ /** * Horde_Argv_Translation is the translation wrapper class for Horde_Argv. * * @author Jan Schneider * @package Argv * @category Horde * @copyright 2010-2017 Horde LLC * @license http://www.horde.org/licenses/bsd BSD */ class Horde_Argv_Translation extends Horde_Translation_Autodetect { /** * The translation domain * * @var string */ protected static $_domain = 'Horde_Argv'; /** * The absolute PEAR path to the translations for the default gettext handler. * * @var string */ protected static $_pearDirectory = '@data_dir@'; } Horde_Argv-2.1.0/lib/Horde/Argv/Values.php0000664000175000017500000000361213102315276016316 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv */ /** * Result hash for Horde_Argv_Parser * * @category Horde * @package Argv * @author Chuck Hagenbuch * @author Mike Naberezny * @copyright 2010-2017 Horde LLC * @license http://www.horde.org/licenses/bsd BSD */ class Horde_Argv_Values implements IteratorAggregate, ArrayAccess, Countable { public function __construct($defaults = array()) { foreach ($defaults as $attr => $val) { $this->$attr = $val; } } public function __toString() { $str = array(); foreach ($this as $attr => $val) { $str[] = $attr . ': ' . (string)$val; } return implode(', ', $str); } public function offsetExists($attr) { return isset($this->$attr) && !is_null($this->$attr); } public function offsetGet($attr) { return $this->$attr; } public function offsetSet($attr, $val) { $this->$attr = $val; } public function offsetUnset($attr) { unset($this->$attr); } public function getIterator() { return new ArrayIterator(get_object_vars($this)); } public function count() { return count(get_object_vars($this)); } public function ensureValue($attr, $value) { if (is_null($this->$attr)) { $this->$attr = $value; } return $this->$attr; } } Horde_Argv-2.1.0/locale/ar/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000073213102315276017643 0ustar janjanÞ•4L`aiAp ²¿OptionsUsage:Project-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit خياراتحجم الاستخدام:Horde_Argv-2.1.0/locale/ar/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000357513102315276017656 0ustar janjan# Arabic translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "خيارات" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "حجم الاستخدام:" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "حجم الاستخدام:" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "خيارات" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/bg/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000072413102315276017632 0ustar janjanÞ•4L`aiAp ²½OptionsUsage:Project-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ОпцииИзползване::Horde_Argv-2.1.0/locale/bg/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000370313102315276017635 0ustar janjan# Bulgarian translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "Опции" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "Използване::" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "Използване::" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "Опции" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 #, fuzzy msgid "show this help message and exit" msgstr " help Покажи това помощно Ñъобщение." Horde_Argv-2.1.0/locale/bs/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000064213102315276017645 0ustar janjanÞ•,<PQAY›OptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OpcijeHorde_Argv-2.1.0/locale/bs/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000352313102315276017651 0ustar janjan# Bosnian translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "Opcije" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "Poruka" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 #, fuzzy msgid "Usage:" msgstr "Poruka" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "Opcije" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/ca/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000064313102315276017625 0ustar janjanÞ•,<PQAY›OptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OpcionsHorde_Argv-2.1.0/locale/ca/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000354513102315276017634 0ustar janjan# Catalan translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "Opcions" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "Ús de la clau" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 #, fuzzy msgid "Usage:" msgstr "Ús de la clau" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "Opcions" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/cs/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000075313102315276017651 0ustar janjanÞ•,<PQ‡Y áOptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2; MožnostiHorde_Argv-2.1.0/locale/cs/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000366313102315276017657 0ustar janjan# Czech translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "Možnosti" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "Užití klíÄe" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 #, fuzzy msgid "Usage:" msgstr "Užití klíÄe" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "Možnosti" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/da/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000267013102315276017630 0ustar janjanÞ•ŒüHIi‰¨°¶ ½0Ç-ø&&+M&y †À!Gi‰§¬±·-¾.ì',C'p˜     %s option does not take a value%s option requires %d arguments%s option requires an argumentOptionsUsageUsage:[options]option %s: invalid choice: '%s' (choose from %s)option %s: invalid floating-point value: '%s'option %s: invalid integer value: '%s'option %s: invalid long integer value: '%s'show program's version number and exitshow this help message and exitProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2013-03-05 10:52+0100 PO-Revision-Date: 2014-03-19 20:09+0100 Last-Translator: Erling Preben Hansen Language-Team: i18n@lists.horde.org Language: da MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); %s valget giver ikke nogen værdi%s valget kræver %d argumenter%s valget kræver et argumentValgBrugBrug:[Valg]valget %s: ugyldigt valg: '%s' (vælg fra %s)valget %s: ugyldig floating-point værdi: '%s'valget %s: ugyldig integer værdi: '%s'Valget %s: ugyldig long integer værdi: '%s'Vis programmernes version nummer og lukVis denne hjælpe besked og lukHorde_Argv-2.1.0/locale/da/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000434113102315276017630 0ustar janjan# Danish translations for Horde_Argv package. # Copyright (C) 2014 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv package. # Erling Preben Hansen , 2013-2014. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2013-03-05 10:52+0100\n" "PO-Revision-Date: 2014-03-19 20:09+0100\n" "Last-Translator: Erling Preben Hansen \n" "Language-Team: i18n@lists.horde.org\n" "Language: da\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Argv/Parser.php:478 #, php-format msgid "%s option does not take a value" msgstr "%s valget giver ikke nogen værdi" #: lib/Horde/Argv/Parser.php:468 lib/Horde/Argv/Parser.php:520 #, php-format msgid "%s option requires %d arguments" msgstr "%s valget kræver %d argumenter" #: lib/Horde/Argv/Parser.php:466 lib/Horde/Argv/Parser.php:518 #, php-format msgid "%s option requires an argument" msgstr "%s valget kræver et argument" #: lib/Horde/Argv/Parser.php:643 msgid "Options" msgstr "Valg" #: lib/Horde/Argv/TitledHelpFormatter.php:29 msgid "Usage" msgstr "Brug" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "Brug:" #: lib/Horde/Argv/Parser.php:169 msgid "[options]" msgstr "[Valg]" #: lib/Horde/Argv/Option.php:122 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "valget %s: ugyldigt valg: '%s' (vælg fra %s)" #: lib/Horde/Argv/Option.php:104 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "valget %s: ugyldig floating-point værdi: '%s'" #: lib/Horde/Argv/Option.php:94 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "valget %s: ugyldig integer værdi: '%s'" #: lib/Horde/Argv/Option.php:95 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "Valget %s: ugyldig long integer værdi: '%s'" #: lib/Horde/Argv/Parser.php:141 msgid "show program's version number and exit" msgstr "Vis programmernes version nummer og luk" #: lib/Horde/Argv/Parser.php:135 msgid "show this help message and exit" msgstr "Vis denne hjælpe besked og luk" Horde_Argv-2.1.0/locale/de/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000272413102315276017634 0ustar janjanÞ•ŒüHIi‰¨°¶ ½0Ç-ø&&+M&y wÀ 8Y y š¨¯ ·8Â-û*)0T&…'¬     %s option does not take a value%s option requires %d arguments%s option requires an argumentOptionsUsageUsage:[options]option %s: invalid choice: '%s' (choose from %s)option %s: invalid floating-point value: '%s'option %s: invalid integer value: '%s'option %s: invalid long integer value: '%s'show program's version number and exitshow this help message and exitProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2013-03-05 10:52+0100 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Option %s erwartet kein ArgumentOption %s erwartet %d ArgumenteOption %s erweitert ein ArgumentEinstellungenAufrufAufruf:[Optionen]Option %s: ungültige Auswahl: '%s' (gültige Werte: %s)Option %s: ungültiger Fließkomma-Wert: '%s'Option %s: ungültiger Ganzzahl-Wert: '%s'Option %s: ungültiger Lange-Ganzzahl-Wert: '%s'Programmversion anzeigen und abbrechendiesen Hilfetext anzeigen und abbrechenHorde_Argv-2.1.0/locale/de/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000435213102315276017636 0ustar janjan# German translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2013-03-05 10:52+0100\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Argv/Parser.php:478 #, php-format msgid "%s option does not take a value" msgstr "Option %s erwartet kein Argument" #: lib/Horde/Argv/Parser.php:468 lib/Horde/Argv/Parser.php:520 #, php-format msgid "%s option requires %d arguments" msgstr "Option %s erwartet %d Argumente" #: lib/Horde/Argv/Parser.php:466 lib/Horde/Argv/Parser.php:518 #, php-format msgid "%s option requires an argument" msgstr "Option %s erweitert ein Argument" #: lib/Horde/Argv/Parser.php:643 msgid "Options" msgstr "Einstellungen" #: lib/Horde/Argv/TitledHelpFormatter.php:29 msgid "Usage" msgstr "Aufruf" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "Aufruf:" #: lib/Horde/Argv/Parser.php:169 msgid "[options]" msgstr "[Optionen]" #: lib/Horde/Argv/Option.php:122 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "Option %s: ungültige Auswahl: '%s' (gültige Werte: %s)" #: lib/Horde/Argv/Option.php:104 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "Option %s: ungültiger Fließkomma-Wert: '%s'" #: lib/Horde/Argv/Option.php:94 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "Option %s: ungültiger Ganzzahl-Wert: '%s'" #: lib/Horde/Argv/Option.php:95 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "Option %s: ungültiger Lange-Ganzzahl-Wert: '%s'" #: lib/Horde/Argv/Parser.php:141 msgid "show program's version number and exit" msgstr "Programmversion anzeigen und abbrechen" #: lib/Horde/Argv/Parser.php:135 msgid "show this help message and exit" msgstr "diesen Hilfetext anzeigen und abbrechen" Horde_Argv-2.1.0/locale/el/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000072713102315276017645 0ustar janjanÞ•,<PQlYÆOptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); ΕπιλογέςHorde_Argv-2.1.0/locale/el/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000367613102315276017656 0ustar janjan# Greek translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "Επιλογές" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "ΧÏήση ΚλειδιοÏ" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 #, fuzzy msgid "Usage:" msgstr "ΧÏήση ΚλειδιοÏ" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "Επιλογές" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/es/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000302513102315276017646 0ustar janjanÞ•ŒüHIi‰¨°¶ ½0Ç-ø&&+M&y ¨À#i%$³Øáå ê;õ51+g1“4Åú     %s option does not take a value%s option requires %d arguments%s option requires an argumentOptionsUsageUsage:[options]option %s: invalid choice: '%s' (choose from %s)option %s: invalid floating-point value: '%s'option %s: invalid integer value: '%s'option %s: invalid long integer value: '%s'show program's version number and exitshow this help message and exitProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2013-03-05 10:52+0100 PO-Revision-Date: 2013-06-11 20:26+0200 Last-Translator: Manuel P. Ayala , Juan C. Blanco Language-Team: i18n@lists.horde.org Language: es MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); La opción %s no toma ningún valorLa opción %s necesita %d parámetrosLa opción %s necesita un parámetroOpcionesUsoUso:[opciones]Opción %s: la elección es no válida '%s' (elegido de %s)Opción %s: número de coma flotante no válido: '%s'Opción %s: número entero no válido: '%s'Opción %s: número entero largo no válido: '%s'mostrar él número de versión del programa y salirmostrar esta ayuda y salirHorde_Argv-2.1.0/locale/es/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000446013102315276017655 0ustar janjan# Spanish translations for Horde_Argv package. # Copyright (C) 2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv package. # Automatically generated, 2013. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv \n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2013-03-05 10:52+0100\n" "PO-Revision-Date: 2013-06-11 20:26+0200\n" "Last-Translator: Manuel P. Ayala , Juan C. Blanco " "\n" "Language-Team: i18n@lists.horde.org\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Argv/Parser.php:478 #, php-format msgid "%s option does not take a value" msgstr "La opción %s no toma ningún valor" #: lib/Horde/Argv/Parser.php:468 lib/Horde/Argv/Parser.php:520 #, php-format msgid "%s option requires %d arguments" msgstr "La opción %s necesita %d parámetros" #: lib/Horde/Argv/Parser.php:466 lib/Horde/Argv/Parser.php:518 #, php-format msgid "%s option requires an argument" msgstr "La opción %s necesita un parámetro" #: lib/Horde/Argv/Parser.php:643 msgid "Options" msgstr "Opciones" #: lib/Horde/Argv/TitledHelpFormatter.php:29 msgid "Usage" msgstr "Uso" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "Uso:" #: lib/Horde/Argv/Parser.php:169 msgid "[options]" msgstr "[opciones]" #: lib/Horde/Argv/Option.php:122 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "Opción %s: la elección es no válida '%s' (elegido de %s)" #: lib/Horde/Argv/Option.php:104 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "Opción %s: número de coma flotante no válido: '%s'" #: lib/Horde/Argv/Option.php:94 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "Opción %s: número entero no válido: '%s'" #: lib/Horde/Argv/Option.php:95 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "Opción %s: número entero largo no válido: '%s'" #: lib/Horde/Argv/Parser.php:141 msgid "show program's version number and exit" msgstr "mostrar él número de versión del programa y salir" #: lib/Horde/Argv/Parser.php:135 msgid "show this help message and exit" msgstr "mostrar esta ayuda y salir" Horde_Argv-2.1.0/locale/et/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000265713102315276017661 0ustar janjanÞ•ŒüHIi‰¨°¶ ½0Ç-ø&&+M&y |À=Zw‘˜ ©,²(ß).2,a Ž     %s option does not take a value%s option requires %d arguments%s option requires an argumentOptionsUsageUsage:[options]option %s: invalid choice: '%s' (choose from %s)option %s: invalid floating-point value: '%s'option %s: invalid integer value: '%s'option %s: invalid long integer value: '%s'show program's version number and exitshow this help message and exitProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2011-02-02 16:17+0100 PO-Revision-Date: 2010-11-09 01:27+0200 Last-Translator: Alar Sing Language-Team: i18n@lists.horde.org Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Valik %s ei võta väärtustValik %s nõuab %d argumentiValik %s nõuab argumentiSeadedKasutusKasutus:[seaded]valik %s: vigane valik: '%s' (vali %s seast)valik %s: vigane murdarv väärtus: '%s'valik %s: vigane täisarv väärtus: '%s'valik %s: vigane suur täisarv väärtus: '%s'näita programmi versiooni numbrit ja väljunäita seda abi teksti ja väljuHorde_Argv-2.1.0/locale/et/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000430713102315276017656 0ustar janjan# Estonian translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2011-02-02 16:17+0100\n" "PO-Revision-Date: 2010-11-09 01:27+0200\n" "Last-Translator: Alar Sing \n" "Language-Team: i18n@lists.horde.org\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Argv/Parser.php:495 #, php-format msgid "%s option does not take a value" msgstr "Valik %s ei võta väärtust" #: lib/Horde/Argv/Parser.php:485 lib/Horde/Argv/Parser.php:537 #, php-format msgid "%s option requires %d arguments" msgstr "Valik %s nõuab %d argumenti" #: lib/Horde/Argv/Parser.php:483 lib/Horde/Argv/Parser.php:535 #, php-format msgid "%s option requires an argument" msgstr "Valik %s nõuab argumenti" #: lib/Horde/Argv/Parser.php:660 msgid "Options" msgstr "Seaded" #: lib/Horde/Argv/TitledHelpFormatter.php:29 msgid "Usage" msgstr "Kasutus" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "Kasutus:" #: lib/Horde/Argv/Parser.php:186 msgid "[options]" msgstr "[seaded]" #: lib/Horde/Argv/Option.php:122 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "valik %s: vigane valik: '%s' (vali %s seast)" #: lib/Horde/Argv/Option.php:104 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "valik %s: vigane murdarv väärtus: '%s'" #: lib/Horde/Argv/Option.php:94 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "valik %s: vigane täisarv väärtus: '%s'" #: lib/Horde/Argv/Option.php:95 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "valik %s: vigane suur täisarv väärtus: '%s'" #: lib/Horde/Argv/Parser.php:158 msgid "show program's version number and exit" msgstr "näita programmi versiooni numbrit ja välju" #: lib/Horde/Argv/Parser.php:152 msgid "show this help message and exit" msgstr "näita seda abi teksti ja välju" Horde_Argv-2.1.0/locale/eu/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000112413102315276017646 0ustar janjanÞ•Dlˆ‰‘— ž‚¨+ 3 > JOptionsUsageUsage:[options]Project-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2012-01-17 12:38+0100 PO-Revision-Date: 2013-01-16 09:23+0100 Last-Translator: Ibon Igartua Language-Team: i18n@lists.horde.org Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); AukerakErabilpenaErabilpena:[aukerak]Horde_Argv-2.1.0/locale/eu/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000361313102315276017656 0ustar janjan# Basque translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2012-01-17 12:38+0100\n" "PO-Revision-Date: 2013-01-16 09:23+0100\n" "Last-Translator: Ibon Igartua \n" "Language-Team: i18n@lists.horde.org\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Argv/Parser.php:495 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:485 lib/Horde/Argv/Parser.php:537 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:483 lib/Horde/Argv/Parser.php:535 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:660 msgid "Options" msgstr "Aukerak" #: lib/Horde/Argv/TitledHelpFormatter.php:29 msgid "Usage" msgstr "Erabilpena" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "Erabilpena:" #: lib/Horde/Argv/Parser.php:186 msgid "[options]" msgstr "[aukerak]" #: lib/Horde/Argv/Option.php:122 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:104 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:94 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:95 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:158 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:152 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/fa/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000066213102315276017631 0ustar janjanÞ•,<PQAY›OptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit گزینه‌هاHorde_Argv-2.1.0/locale/fa/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000362113102315276017632 0ustar janjan# Persian translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "گزینه‌ها" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "کاربرد کلید" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 #, fuzzy msgid "Usage:" msgstr "کاربرد کلید" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "گزینه‌ها" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/fi/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000272013102315276017636 0ustar janjanÞ•ŒüHIi‰¨°¶ ½0Ç-ø&&+M&y ‰ÀJf…  ª ³ ½<É&)-.W&†"­     %s option does not take a value%s option requires %d arguments%s option requires an argumentOptionsUsageUsage:[options]option %s: invalid choice: '%s' (choose from %s)option %s: invalid floating-point value: '%s'option %s: invalid integer value: '%s'option %s: invalid long integer value: '%s'show program's version number and exitshow this help message and exitProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2011-02-02 16:17+0100 PO-Revision-Date: 2012-03-07 15:04:02+0200 Last-Translator: Leena Heino Language-Team: Finnish Language: fi MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); %s optiolle ei anneta arvoa%s optio vaatii %d argumenttia%s optio vaatii argumentinAsetuksetKäyttöKäyttö:[asetukset]optio %s: väärä valinta: '%s' (valitse vaihtoehdoista %s)optio %s: väärä liukulukuarvo: '%s'optio %s: väärä kokonaislukuarvo: '%s'optio %s: väärä suurikokonaislukuarvo: '%s'näytä ohjelman versiotieto ja poistunäytä tämä apuviesti ja poistuHorde_Argv-2.1.0/locale/fi/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000435713102315276017651 0ustar janjan# Finnish translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Leena Heino , 2010-2012. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2011-02-02 16:17+0100\n" "PO-Revision-Date: 2012-03-07 15:04:02+0200\n" "Last-Translator: Leena Heino \n" "Language-Team: Finnish \n" "Language: fi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Argv/Parser.php:495 #, php-format msgid "%s option does not take a value" msgstr "%s optiolle ei anneta arvoa" #: lib/Horde/Argv/Parser.php:485 lib/Horde/Argv/Parser.php:537 #, php-format msgid "%s option requires %d arguments" msgstr "%s optio vaatii %d argumenttia" #: lib/Horde/Argv/Parser.php:483 lib/Horde/Argv/Parser.php:535 #, php-format msgid "%s option requires an argument" msgstr "%s optio vaatii argumentin" #: lib/Horde/Argv/Parser.php:660 msgid "Options" msgstr "Asetukset" #: lib/Horde/Argv/TitledHelpFormatter.php:29 msgid "Usage" msgstr "Käyttö" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "Käyttö:" #: lib/Horde/Argv/Parser.php:186 msgid "[options]" msgstr "[asetukset]" #: lib/Horde/Argv/Option.php:122 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "optio %s: väärä valinta: '%s' (valitse vaihtoehdoista %s)" #: lib/Horde/Argv/Option.php:104 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "optio %s: väärä liukulukuarvo: '%s'" #: lib/Horde/Argv/Option.php:94 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "optio %s: väärä kokonaislukuarvo: '%s'" #: lib/Horde/Argv/Option.php:95 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "optio %s: väärä suurikokonaislukuarvo: '%s'" #: lib/Horde/Argv/Parser.php:158 msgid "show program's version number and exit" msgstr "näytä ohjelman versiotieto ja poistu" #: lib/Horde/Argv/Parser.php:152 msgid "show this help message and exit" msgstr "näytä tämä apuviesti ja poistu" Horde_Argv-2.1.0/locale/fr/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000303013102315276017642 0ustar janjanÞ•ŒüHIi‰¨°¶ ½0Ç-ø&&+M&y ÀÀ"#¤"Èë ó ÿ =(T)})§)Ñû     %s option does not take a value%s option requires %d arguments%s option requires an argumentOptionsUsageUsage:[options]option %s: invalid choice: '%s' (choose from %s)option %s: invalid floating-point value: '%s'option %s: invalid integer value: '%s'option %s: invalid long integer value: '%s'show program's version number and exitshow this help message and exitProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2012-01-17 12:38+0100 PO-Revision-Date: 2013-01-14 10:12+0100 Last-Translator: Paul De Vlieger Language-Team: French Language: fr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n > 1); X-Generator: Lokalize 1.4 L'option %s ne prend pas de valeurL'option %s nécessite %d argumentsL'option %s nécessite un argumentOptionsUtilisationUtilisation:[options]Option %s: choix invalide: '%s' (valeur à choisir parmi: %s)Option %s: valeur réelle invalide: '%s'Option %s: valeur entière invalide: '%s'Option %s: valeur entière invalide: '%s'Affiche la version du programme et quitteAffiche ce message et quitteHorde_Argv-2.1.0/locale/fr/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000456713102315276017665 0ustar janjan# French translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # Paul De Vlieger , 2013 msgid "" msgstr "" "Project-Id-Version: Horde_Argv \n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2012-01-17 12:38+0100\n" "PO-Revision-Date: 2013-01-14 10:12+0100\n" "Last-Translator: Paul De Vlieger \n" "Language-Team: French \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" "X-Generator: Lokalize 1.4\n" #: lib/Horde/Argv/Parser.php:495 #, php-format msgid "%s option does not take a value" msgstr "L'option %s ne prend pas de valeur" #: lib/Horde/Argv/Parser.php:485 lib/Horde/Argv/Parser.php:537 #, php-format msgid "%s option requires %d arguments" msgstr "L'option %s nécessite %d arguments" #: lib/Horde/Argv/Parser.php:483 lib/Horde/Argv/Parser.php:535 #, php-format msgid "%s option requires an argument" msgstr "L'option %s nécessite un argument" #: lib/Horde/Argv/Parser.php:660 msgid "Options" msgstr "Options" #: lib/Horde/Argv/TitledHelpFormatter.php:29 msgid "Usage" msgstr "Utilisation" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "Utilisation:" #: lib/Horde/Argv/Parser.php:186 msgid "[options]" msgstr "[options]" #: lib/Horde/Argv/Option.php:122 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "Option %s: choix invalide: '%s' (valeur à choisir parmi: %s)" #: lib/Horde/Argv/Option.php:104 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "Option %s: valeur réelle invalide: '%s'" #: lib/Horde/Argv/Option.php:94 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "Option %s: valeur entière invalide: '%s'" #: lib/Horde/Argv/Option.php:95 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "Option %s: valeur entière invalide: '%s'" #: lib/Horde/Argv/Parser.php:158 msgid "show program's version number and exit" msgstr "Affiche la version du programme et quitte" #: lib/Horde/Argv/Parser.php:152 msgid "show this help message and exit" msgstr "Affiche ce message et quitte" Horde_Argv-2.1.0/locale/gl/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000064413102315276017645 0ustar janjanÞ•,<PQAY›OptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OpciónsHorde_Argv-2.1.0/locale/gl/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000353213102315276017647 0ustar janjan# Galician translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "Opcións" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "Mensaxe" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 #, fuzzy msgid "Usage:" msgstr "Mensaxe" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "Opcións" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/he/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000072713102315276017641 0ustar janjanÞ•,<PQlYÆOptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); ×פשרויותHorde_Argv-2.1.0/locale/he/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000356713102315276017651 0ustar janjan# Hebrew translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "×פשרויות" #: lib/Horde/Argv/TitledHelpFormatter.php:29 msgid "Usage" msgstr "" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "×פשרויות" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/hr/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000307513102315276017655 0ustar janjanÞ•ŒüHIi‰¨°¶ ½0Ç-ø&&+M&y ÕÀ–!²Ôñ ø 80S2„=·"õ$     %s option does not take a value%s option requires %d arguments%s option requires an argumentOptionsUsageUsage:[options]option %s: invalid choice: '%s' (choose from %s)option %s: invalid floating-point value: '%s'option %s: invalid integer value: '%s'option %s: invalid long integer value: '%s'show program's version number and exitshow this help message and exitProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2011-02-02 16:17+0100 PO-Revision-Date: 2011-11-08 16:49+0200 Last-Translator: Valentin Vidic Language-Team: i18n@lists.horde.org Language: hr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); opcija %s ne uzima argumentopcija %s zahtijeva %d argumenataopcija %s zahtijeva argumentOpcijeKoriÅ¡tenjeKoriÅ¡tenje:[opcije]opcija %s: neispravan izbor: '%s' (izaberite izmeÄ‘u %s)opcija %s: neispravna decimalna vrijednost: '%s'opcija %s: neispravna cjelobrojna vrijednost: '%s'opcija %s: neispravna cjelobrojna vrijednost duzeg tipa: '%s'prikaži verziju programa i izaÄ‘iprikaži ovu poruku pomoći i izaÄ‘iHorde_Argv-2.1.0/locale/hr/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000455213102315276017661 0ustar janjan# Croatian translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Valentin Vidic , 2011. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2011-02-02 16:17+0100\n" "PO-Revision-Date: 2011-11-08 16:49+0200\n" "Last-Translator: Valentin Vidic \n" "Language-Team: i18n@lists.horde.org\n" "Language: hr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: lib/Horde/Argv/Parser.php:495 #, php-format msgid "%s option does not take a value" msgstr "opcija %s ne uzima argument" #: lib/Horde/Argv/Parser.php:485 lib/Horde/Argv/Parser.php:537 #, php-format msgid "%s option requires %d arguments" msgstr "opcija %s zahtijeva %d argumenata" #: lib/Horde/Argv/Parser.php:483 lib/Horde/Argv/Parser.php:535 #, php-format msgid "%s option requires an argument" msgstr "opcija %s zahtijeva argument" #: lib/Horde/Argv/Parser.php:660 msgid "Options" msgstr "Opcije" #: lib/Horde/Argv/TitledHelpFormatter.php:29 msgid "Usage" msgstr "KoriÅ¡tenje" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "KoriÅ¡tenje:" #: lib/Horde/Argv/Parser.php:186 msgid "[options]" msgstr "[opcije]" #: lib/Horde/Argv/Option.php:122 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "opcija %s: neispravan izbor: '%s' (izaberite izmeÄ‘u %s)" #: lib/Horde/Argv/Option.php:104 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "opcija %s: neispravna decimalna vrijednost: '%s'" #: lib/Horde/Argv/Option.php:94 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "opcija %s: neispravna cjelobrojna vrijednost: '%s'" #: lib/Horde/Argv/Option.php:95 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "opcija %s: neispravna cjelobrojna vrijednost duzeg tipa: '%s'" #: lib/Horde/Argv/Parser.php:158 msgid "show program's version number and exit" msgstr "prikaži verziju programa i izaÄ‘i" #: lib/Horde/Argv/Parser.php:152 msgid "show this help message and exit" msgstr "prikaži ovu poruku pomoći i izaÄ‘i" Horde_Argv-2.1.0/locale/hu/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000306113102315276017653 0ustar janjanÞ•ŒüHIi‰¨°¶ ½0Ç-ø&&+M&y …À#F,j-—Å Í Ø ä<î4+-`5Ž8Ä3ý     %s option does not take a value%s option requires %d arguments%s option requires an argumentOptionsUsageUsage:[options]option %s: invalid choice: '%s' (choose from %s)option %s: invalid floating-point value: '%s'option %s: invalid integer value: '%s'option %s: invalid long integer value: '%s'show program's version number and exitshow this help message and exitProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2013-03-05 10:52+0100 PO-Revision-Date: 2014-07-14 11:35+0200 Last-Translator: Andras Galos Language-Team: i18n@lists.horde.org Language: hu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); A %s paraméterhez nem kell értékA %s paraméterhez %d argumentum szükségesA %s paraméterhez egy argumentum szükségesOpciókHasználatHasználat:[opciók]%s opció: érvénytelen választás: '%s' (lehetséges: %s)%s opció: érvénytelen lebegÅ‘pontos érték: '%s'%s opció: érvénytelen egész érték: '%s'%s opció: érvénytelen hosszú egész érték: '%s' program verziószámának megjelenítése és kilépésEnnek az üzenetnem a megjelenítése és kilépésHorde_Argv-2.1.0/locale/hu/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000451213102315276017660 0ustar janjan# Hungarian translations for Horde_Argv module. # Copyright 2010-2013 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv \n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2013-03-05 10:52+0100\n" "PO-Revision-Date: 2014-07-14 11:35+0200\n" "Last-Translator: Andras Galos \n" "Language-Team: i18n@lists.horde.org\n" "Language: hu\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Argv/Parser.php:478 #, php-format msgid "%s option does not take a value" msgstr "A %s paraméterhez nem kell érték" #: lib/Horde/Argv/Parser.php:468 lib/Horde/Argv/Parser.php:520 #, php-format msgid "%s option requires %d arguments" msgstr "A %s paraméterhez %d argumentum szükséges" #: lib/Horde/Argv/Parser.php:466 lib/Horde/Argv/Parser.php:518 #, php-format msgid "%s option requires an argument" msgstr "A %s paraméterhez egy argumentum szükséges" #: lib/Horde/Argv/Parser.php:643 msgid "Options" msgstr "Opciók" #: lib/Horde/Argv/TitledHelpFormatter.php:29 msgid "Usage" msgstr "Használat" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "Használat:" #: lib/Horde/Argv/Parser.php:169 msgid "[options]" msgstr "[opciók]" #: lib/Horde/Argv/Option.php:122 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "%s opció: érvénytelen választás: '%s' (lehetséges: %s)" #: lib/Horde/Argv/Option.php:104 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "%s opció: érvénytelen lebegÅ‘pontos érték: '%s'" #: lib/Horde/Argv/Option.php:94 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "%s opció: érvénytelen egész érték: '%s'" #: lib/Horde/Argv/Option.php:95 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "%s opció: érvénytelen hosszú egész érték: '%s'" #: lib/Horde/Argv/Parser.php:141 msgid "show program's version number and exit" msgstr " program verziószámának megjelenítése és kilépés" #: lib/Horde/Argv/Parser.php:135 msgid "show this help message and exit" msgstr "Ennek az üzenetnem a megjelenítése és kilépés" Horde_Argv-2.1.0/locale/id/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000064313102315276017636 0ustar janjanÞ•,<PQAY›OptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=ASCII Content-Transfer-Encoding: 8bit PilihanHorde_Argv-2.1.0/locale/id/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000347213102315276017644 0ustar janjan# Indonesian translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ASCII\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "Pilihan" #: lib/Horde/Argv/TitledHelpFormatter.php:29 msgid "Usage" msgstr "" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "Pilihan" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/is/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000065113102315276017654 0ustar janjanÞ•,<PQAY ›OptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ValstillingarHorde_Argv-2.1.0/locale/is/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000354313102315276017662 0ustar janjan# Icelandic translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "Valstillingar" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "Skeyti" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 #, fuzzy msgid "Usage:" msgstr "Skeyti" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "Valstillingar" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/it/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000071613102315276017657 0ustar janjanÞ•,<PQlYÆOptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); OpzioniHorde_Argv-2.1.0/locale/it/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000362613102315276017665 0ustar janjan# Italian translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "Opzioni" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "Utilizzo chiave" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 #, fuzzy msgid "Usage:" msgstr "Utilizzo chiave" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "Opzioni" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/ja/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000321413102315276017631 0ustar janjanÞ•ŒüHIi‰¨°¶ ½0Ç-ø&&+M&y À(^8‡7Àø  G15y5¯;å<!-^     %s option does not take a value%s option requires %d arguments%s option requires an argumentOptionsUsageUsage:[options]option %s: invalid choice: '%s' (choose from %s)option %s: invalid floating-point value: '%s'option %s: invalid integer value: '%s'option %s: invalid long integer value: '%s'show program's version number and exitshow this help message and exitProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2013-03-05 10:52+0100 PO-Revision-Date: 2013-03-10 11:02+0900 Last-Translator: Hiromi Kimura Language-Team: i18n@lists.horde.org Language: ja MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; X-Generator: Poedit 1.5.4 オプション %s ã«å€¤ã¯ä¸è¦ã§ã™ã‚ªãƒ—ション %s ã«ã¯ %d ã¤ã®å¼•æ•°ãŒå¿…è¦ã§ã™ã‚ªãƒ—ション %s ã«ã¯ï¼‘ã¤ã®å¼•æ•°ãŒå¿…è¦ã§ã™ã‚ªãƒ—ã‚·ãƒ§ãƒ³ä½¿ã„æ–¹ä½¿ã„方:[オプション]オプション %s:無効ãªé¸æŠžã§ã™ï¼š '%s'(%s ã‹ã‚‰é¸æŠžï¼‰ã‚ªãƒ—ション %s:無効ãªå®Ÿæ•°å€¤ã§ã™ï¼š '%s'オプション %sï¼šç„¡åŠ¹ãªæ•´æ•°å€¤ã§ã™ï¼š '%s'オプション %sï¼šç„¡åŠ¹ãªæ•´æ•°å€¤(long)ã§ã™ï¼š '%s'プログラムã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’表示ã—ã¦çµ‚了ã™ã‚‹ã“ã®ãƒ˜ãƒ«ãƒ—文を表示ã—ã¦çµ‚了ã™ã‚‹Horde_Argv-2.1.0/locale/ja/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000464113102315276017641 0ustar janjan# Japanese translation for Horde. # Copyright 2004-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde package. # Hiromi Kimura # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2013-03-05 10:52+0100\n" "PO-Revision-Date: 2013-03-10 11:02+0900\n" "Last-Translator: Hiromi Kimura \n" "Language-Team: i18n@lists.horde.org\n" "Language: ja\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" "X-Generator: Poedit 1.5.4\n" #: lib/Horde/Argv/Parser.php:478 #, php-format msgid "%s option does not take a value" msgstr "オプション %s ã«å€¤ã¯ä¸è¦ã§ã™" #: lib/Horde/Argv/Parser.php:468 lib/Horde/Argv/Parser.php:520 #, php-format msgid "%s option requires %d arguments" msgstr "オプション %s ã«ã¯ %d ã¤ã®å¼•æ•°ãŒå¿…è¦ã§ã™" #: lib/Horde/Argv/Parser.php:466 lib/Horde/Argv/Parser.php:518 #, php-format msgid "%s option requires an argument" msgstr "オプション %s ã«ã¯ï¼‘ã¤ã®å¼•æ•°ãŒå¿…è¦ã§ã™" #: lib/Horde/Argv/Parser.php:643 msgid "Options" msgstr "オプション" #: lib/Horde/Argv/TitledHelpFormatter.php:29 msgid "Usage" msgstr "ä½¿ã„æ–¹" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "ä½¿ã„æ–¹ï¼š" #: lib/Horde/Argv/Parser.php:169 msgid "[options]" msgstr "[オプション]" #: lib/Horde/Argv/Option.php:122 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "オプション %s:無効ãªé¸æŠžã§ã™ï¼š '%s'(%s ã‹ã‚‰é¸æŠžï¼‰" #: lib/Horde/Argv/Option.php:104 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "オプション %s:無効ãªå®Ÿæ•°å€¤ã§ã™ï¼š '%s'" #: lib/Horde/Argv/Option.php:94 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "オプション %sï¼šç„¡åŠ¹ãªæ•´æ•°å€¤ã§ã™ï¼š '%s'" #: lib/Horde/Argv/Option.php:95 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "オプション %sï¼šç„¡åŠ¹ãªæ•´æ•°å€¤(long)ã§ã™ï¼š '%s'" #: lib/Horde/Argv/Parser.php:141 msgid "show program's version number and exit" msgstr "プログラムã®ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã‚’表示ã—ã¦çµ‚了ã™ã‚‹" #: lib/Horde/Argv/Parser.php:135 msgid "show this help message and exit" msgstr "ã“ã®ãƒ˜ãƒ«ãƒ—文を表示ã—ã¦çµ‚了ã™ã‚‹" Horde_Argv-2.1.0/locale/km/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000066113102315276017651 0ustar janjanÞ•,<PQAY›OptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ជម្រើស​Horde_Argv-2.1.0/locale/km/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000356513102315276017662 0ustar janjan# Khmer translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "ជម្រើស​" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "សារ" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 #, fuzzy msgid "Usage:" msgstr "សារ" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "ជម្រើស​" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/ko/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000071413102315276017652 0ustar janjanÞ•,<PQeY ¿OptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; ì„ íƒì‚¬í•­Horde_Argv-2.1.0/locale/ko/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000361413102315276017657 0ustar janjan# Korean translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "ì„ íƒì‚¬í•­" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "메시지" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 #, fuzzy msgid "Usage:" msgstr "메시지" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "ì„ íƒì‚¬í•­" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/lt/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000311313102315276017654 0ustar janjanÞ•ŒüHIi‰¨°¶ ½0Ç-ø&&+M&y ¹À!z"œ¿ Þ é ô B 5P4†<»&ø+     %s option does not take a value%s option requires %d arguments%s option requires an argumentOptionsUsageUsage:[options]option %s: invalid choice: '%s' (choose from %s)option %s: invalid floating-point value: '%s'option %s: invalid integer value: '%s'option %s: invalid long integer value: '%s'show program's version number and exitshow this help message and exitProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2011-05-28 01:09+0300 PO-Revision-Date: 2011-06-27 22:26+0300 Last-Translator: Vilius Å umskas Language-Team: Lithuanian MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n%100<10 || n%100>=20) ? 1 : 2); %s parametrui nereikia reikÅ¡mÄ—s%s parametrui reikia %d argumentų%s parametrui reikia argumentoNustatymaiNaudojimasNaudojimas:[parametrai]parametras %s: neteisingas pasirinkimas: '%s' (pasirinkite iÅ¡ %s)parametras %s: neteisinga reikÅ¡mÄ— su kableliu: '%s'parametras %s: neteisinga skaiÄiaus reikÅ¡mÄ—: '%s'parametras %s: neteisinga didelio skaiÄiaus reikÅ¡mÄ—: '%s'parodyti programos versijÄ… ir iÅ¡eitiparodyti Å¡iÄ… pagalbos žinutÄ™ ir iÅ¡eitiHorde_Argv-2.1.0/locale/lt/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000455413102315276017671 0ustar janjan# Lithuanian translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Vilius Å umskas , 2011. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2011-05-28 01:09+0300\n" "PO-Revision-Date: 2011-06-27 22:26+0300\n" "Last-Translator: Vilius Å umskas \n" "Language-Team: Lithuanian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && (n" "%100<10 || n%100>=20) ? 1 : 2);\n" #: lib/Horde/Argv/Parser.php:495 #, php-format msgid "%s option does not take a value" msgstr "%s parametrui nereikia reikÅ¡mÄ—s" #: lib/Horde/Argv/Parser.php:485 lib/Horde/Argv/Parser.php:537 #, php-format msgid "%s option requires %d arguments" msgstr "%s parametrui reikia %d argumentų" #: lib/Horde/Argv/Parser.php:483 lib/Horde/Argv/Parser.php:535 #, php-format msgid "%s option requires an argument" msgstr "%s parametrui reikia argumento" #: lib/Horde/Argv/Parser.php:660 msgid "Options" msgstr "Nustatymai" #: lib/Horde/Argv/TitledHelpFormatter.php:29 msgid "Usage" msgstr "Naudojimas" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "Naudojimas:" #: lib/Horde/Argv/Parser.php:186 msgid "[options]" msgstr "[parametrai]" #: lib/Horde/Argv/Option.php:122 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "parametras %s: neteisingas pasirinkimas: '%s' (pasirinkite iÅ¡ %s)" #: lib/Horde/Argv/Option.php:104 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "parametras %s: neteisinga reikÅ¡mÄ— su kableliu: '%s'" #: lib/Horde/Argv/Option.php:94 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "parametras %s: neteisinga skaiÄiaus reikÅ¡mÄ—: '%s'" #: lib/Horde/Argv/Option.php:95 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "parametras %s: neteisinga didelio skaiÄiaus reikÅ¡mÄ—: '%s'" #: lib/Horde/Argv/Parser.php:158 msgid "show program's version number and exit" msgstr "parodyti programos versijÄ… ir iÅ¡eiti" #: lib/Horde/Argv/Parser.php:152 msgid "show this help message and exit" msgstr "parodyti Å¡iÄ… pagalbos žinutÄ™ ir iÅ¡eiti" Horde_Argv-2.1.0/locale/lv/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000315513102315276017664 0ustar janjanÞ•ŒüHIi‰¨°¶ ½0Ç-ø&&+M&y òÀ³%Í"ó  ) 57?5w-­2Û-0<     %s option does not take a value%s option requires %d arguments%s option requires an argumentOptionsUsageUsage:[options]option %s: invalid choice: '%s' (choose from %s)option %s: invalid floating-point value: '%s'option %s: invalid integer value: '%s'option %s: invalid long integer value: '%s'show program's version number and exitshow this help message and exitProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2011-02-02 16:17+0100 PO-Revision-Date: 2011-10-16 15:21+0300 Last-Translator: JÄnis Eisaks Language-Team: i18n@lists.horde.org Language: lv MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : 2); X-Poedit-Language: Latvian X-Poedit-Country: LATVIA X-Poedit-SourceCharset: utf-8 %s opcijai nav vÄ“rtÄ«bas%s opcijai nepiecieÅ¡ami %d argumenti%s opcijai nepiecieÅ¡ams argumentsOpcijasLietoÅ¡anaLietoÅ¡ana:[opcijas]%s opcija: nepareiza izvÄ“le: '%s' (izvÄ“lieties no %s)%s opcija: nederÄ«ga peldoÅ¡Ä punkta vÄ“rtÄ«ba: '%s'%s opcija: nederÄ«gÄ veselÄ vÄ“rtÄ«ba: '%s'%s opcija: nederÄ«ga garÄ veselÄ vÄ“rtÄ«ba: '%s'parÄdÄ«t programmas versijas numuru un izietparÄdÄ«t Å¡o palÄ«dzÄ«bas informÄciju un izietHorde_Argv-2.1.0/locale/lv/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000462513102315276017672 0ustar janjan# Latvian translations for Horde_Argv package. # Copyright 2011-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv package. # Automatically generated, 2011. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2011-02-02 16:17+0100\n" "PO-Revision-Date: 2011-10-16 15:21+0300\n" "Last-Translator: JÄnis Eisaks \n" "Language-Team: i18n@lists.horde.org\n" "Language: lv\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : " "2);\n" "X-Poedit-Language: Latvian\n" "X-Poedit-Country: LATVIA\n" "X-Poedit-SourceCharset: utf-8\n" #: lib/Horde/Argv/Parser.php:495 #, php-format msgid "%s option does not take a value" msgstr "%s opcijai nav vÄ“rtÄ«bas" #: lib/Horde/Argv/Parser.php:485 lib/Horde/Argv/Parser.php:537 #, php-format msgid "%s option requires %d arguments" msgstr "%s opcijai nepiecieÅ¡ami %d argumenti" #: lib/Horde/Argv/Parser.php:483 lib/Horde/Argv/Parser.php:535 #, php-format msgid "%s option requires an argument" msgstr "%s opcijai nepiecieÅ¡ams arguments" #: lib/Horde/Argv/Parser.php:660 msgid "Options" msgstr "Opcijas" #: lib/Horde/Argv/TitledHelpFormatter.php:29 msgid "Usage" msgstr "LietoÅ¡ana" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "LietoÅ¡ana:" #: lib/Horde/Argv/Parser.php:186 msgid "[options]" msgstr "[opcijas]" #: lib/Horde/Argv/Option.php:122 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "%s opcija: nepareiza izvÄ“le: '%s' (izvÄ“lieties no %s)" #: lib/Horde/Argv/Option.php:104 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "%s opcija: nederÄ«ga peldoÅ¡Ä punkta vÄ“rtÄ«ba: '%s'" #: lib/Horde/Argv/Option.php:94 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "%s opcija: nederÄ«gÄ veselÄ vÄ“rtÄ«ba: '%s'" #: lib/Horde/Argv/Option.php:95 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "%s opcija: nederÄ«ga garÄ veselÄ vÄ“rtÄ«ba: '%s'" #: lib/Horde/Argv/Parser.php:158 msgid "show program's version number and exit" msgstr "parÄdÄ«t programmas versijas numuru un iziet" #: lib/Horde/Argv/Parser.php:152 msgid "show this help message and exit" msgstr "parÄdÄ«t Å¡o palÄ«dzÄ«bas informÄciju un iziet" Horde_Argv-2.1.0/locale/mk/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000057313102315276017653 0ustar janjanÞ•$,8A9Project-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Horde_Argv-2.1.0/locale/mk/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000355713102315276017663 0ustar janjan# Macedonian translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 #, fuzzy msgid "Options" msgstr "Зачувај опции" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "Порака" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 #, fuzzy msgid "Usage:" msgstr "Порака" #: lib/Horde/Argv/Parser.php:199 msgid "[options]" msgstr "" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/nb/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000075013102315276017640 0ustar janjanÞ•4L`ailpÝâOptionsUsage:Project-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); ValgBruk:Horde_Argv-2.1.0/locale/nb/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000357413102315276017652 0ustar janjan# Norwegian Bokmal translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "Valg" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "Bruk:" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "Bruk:" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "Valg" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/nl/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000276213102315276017657 0ustar janjanÞ•ŒüHIi‰¨°¶ ½0Ç-ø&&+M&y ­À n!"±ÔÛãì-õ.#%R*x,£!Ð     %s option does not take a value%s option requires %d arguments%s option requires an argumentOptionsUsageUsage:[options]option %s: invalid choice: '%s' (choose from %s)option %s: invalid floating-point value: '%s'option %s: invalid integer value: '%s'option %s: invalid long integer value: '%s'show program's version number and exitshow this help message and exitProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2012-01-17 12:38+0100 PO-Revision-Date: 2012-11-02 20:33+0100 Last-Translator: Arjen de Korte Language-Team: Dutch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); Language: nl X-Generator: Lokalize 1.4 optie %s heeft geen waarde nodigoptie %s heeft %d parameter nodigoptie %s heeft een parameter nodigOptiesGebruikGebruik:[opties]optie %s: ongeldige keuze: '%s' (kies uit %s)optie %s: ongeldig drijvende komma getal: '%s'optie %s: ongeldig geheel getal: '%s'optie %s: ongeldig lang geheel getal: '%s'toon versie nummer van programma en sluit aftoon dit help bericht en sluit afHorde_Argv-2.1.0/locale/nl/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000443513102315276017661 0ustar janjan# Dutch translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # # Arjen de Korte , 2012. msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2012-01-17 12:38+0100\n" "PO-Revision-Date: 2012-11-02 20:33+0100\n" "Last-Translator: Arjen de Korte \n" "Language-Team: Dutch \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "Language: nl\n" "X-Generator: Lokalize 1.4\n" #: lib/Horde/Argv/Parser.php:495 #, php-format msgid "%s option does not take a value" msgstr "optie %s heeft geen waarde nodig" #: lib/Horde/Argv/Parser.php:485 lib/Horde/Argv/Parser.php:537 #, php-format msgid "%s option requires %d arguments" msgstr "optie %s heeft %d parameter nodig" #: lib/Horde/Argv/Parser.php:483 lib/Horde/Argv/Parser.php:535 #, php-format msgid "%s option requires an argument" msgstr "optie %s heeft een parameter nodig" #: lib/Horde/Argv/Parser.php:660 msgid "Options" msgstr "Opties" #: lib/Horde/Argv/TitledHelpFormatter.php:29 msgid "Usage" msgstr "Gebruik" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "Gebruik:" #: lib/Horde/Argv/Parser.php:186 msgid "[options]" msgstr "[opties]" #: lib/Horde/Argv/Option.php:122 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "optie %s: ongeldige keuze: '%s' (kies uit %s)" #: lib/Horde/Argv/Option.php:104 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "optie %s: ongeldig drijvende komma getal: '%s'" #: lib/Horde/Argv/Option.php:94 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "optie %s: ongeldig geheel getal: '%s'" #: lib/Horde/Argv/Option.php:95 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "optie %s: ongeldig lang geheel getal: '%s'" #: lib/Horde/Argv/Parser.php:158 msgid "show program's version number and exit" msgstr "toon versie nummer van programma en sluit af" #: lib/Horde/Argv/Parser.php:152 msgid "show this help message and exit" msgstr "toon dit help bericht en sluit af" Horde_Argv-2.1.0/locale/nn/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000072113102315276017652 0ustar janjanÞ•,<PQlY ÆOptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); AlternativHorde_Argv-2.1.0/locale/nn/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000362613102315276017664 0ustar janjan# Norwegian Nynorsk translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "Alternativ" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "Melding" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 #, fuzzy msgid "Usage:" msgstr "Melding" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "Alternativ" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/pl/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000100613102315276017647 0ustar janjanÞ•,<PQ¦YOptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); OpcjeHorde_Argv-2.1.0/locale/pl/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000370613102315276017663 0ustar janjan# Polish translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 " "|| n%100>=20) ? 1 : 2);\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "Opcje" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "Wiadomość" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 #, fuzzy msgid "Usage:" msgstr "Wiadomość" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "Opcje" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/pt/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000071713102315276017667 0ustar janjanÞ•,<PQlYÆOptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); OpçõesHorde_Argv-2.1.0/locale/pt/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000364713102315276017677 0ustar janjan# Portuguese translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "Opções" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "Utilização da Chave" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 #, fuzzy msgid "Usage:" msgstr "Utilização da Chave" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "Opções" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/pt_BR/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000272013102315276020246 0ustar janjanÞ•ŒüHIi‰¨°¶ ½0Ç-ø&&+M&y vÀ7Uu” ª ¯3º4î)#/M-}$«     %s option does not take a value%s option requires %d arguments%s option requires an argumentOptionsUsageUsage:[options]option %s: invalid choice: '%s' (choose from %s)option %s: invalid floating-point value: '%s'option %s: invalid integer value: '%s'option %s: invalid long integer value: '%s'show program's version number and exitshow this help message and exitProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2013-03-05 10:52+0100 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n > 1); Opção %s não leva um valoropção %s requer %d argumentosopção %s requer um argumentoOpçõesUtilizaçãoUso:[opções]opção %s: escolha inválida: '%s' (escolha de %s)opção %s: valor de ponto flutuante inválido: '%s'opção %s: valor inteiro inválido: '%s'opção %s: valor inteiro longo inválido: '%s'mostrar número da versão de programa e sairexibir esta mensagem de ajuda e sairHorde_Argv-2.1.0/locale/pt_BR/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000435213102315276020254 0ustar janjan# Portuguese translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2013-03-05 10:52+0100\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: lib/Horde/Argv/Parser.php:478 #, php-format msgid "%s option does not take a value" msgstr "Opção %s não leva um valor" #: lib/Horde/Argv/Parser.php:468 lib/Horde/Argv/Parser.php:520 #, php-format msgid "%s option requires %d arguments" msgstr "opção %s requer %d argumentos" #: lib/Horde/Argv/Parser.php:466 lib/Horde/Argv/Parser.php:518 #, php-format msgid "%s option requires an argument" msgstr "opção %s requer um argumento" #: lib/Horde/Argv/Parser.php:643 msgid "Options" msgstr "Opções" #: lib/Horde/Argv/TitledHelpFormatter.php:29 msgid "Usage" msgstr "Utilização" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "Uso:" #: lib/Horde/Argv/Parser.php:169 msgid "[options]" msgstr "[opções]" #: lib/Horde/Argv/Option.php:122 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "opção %s: escolha inválida: '%s' (escolha de %s)" #: lib/Horde/Argv/Option.php:104 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "opção %s: valor de ponto flutuante inválido: '%s'" #: lib/Horde/Argv/Option.php:94 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "opção %s: valor inteiro inválido: '%s'" #: lib/Horde/Argv/Option.php:95 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "opção %s: valor inteiro longo inválido: '%s'" #: lib/Horde/Argv/Parser.php:141 msgid "show program's version number and exit" msgstr "mostrar número da versão de programa e sair" #: lib/Horde/Argv/Parser.php:135 msgid "show this help message and exit" msgstr "exibir esta mensagem de ajuda e sair" Horde_Argv-2.1.0/locale/ro/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000077413102315276017667 0ustar janjanÞ•,<PQšYôOptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=ASCII Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < 20)) ? 1 : 2; OptiuniHorde_Argv-2.1.0/locale/ro/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000366413102315276017673 0ustar janjan# Romanian translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=ASCII\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < " "20)) ? 1 : 2;\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "Optiuni" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "Mesaj" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 #, fuzzy msgid "Usage:" msgstr "Mesaj" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "Optiuni" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/ru/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000151213102315276017664 0ustar janjanÞ•Dlˆ‰©Éè¶ð.§2Ö- 7%s option does not take a value%s option requires %d arguments%s option requires an argumentOptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); ÐžÐ¿Ñ†Ð¸Ñ %s не имеет Ð·Ð½Ð°Ñ‡ÐµÐ½Ð¸Ð¹ÐžÐ¿Ñ†Ð¸Ñ %s требует аргументы %dÐžÐ¿Ñ†Ð¸Ñ %s требует аргументÐаÑтройкиHorde_Argv-2.1.0/locale/ru/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000426013102315276017672 0ustar janjan# Russian translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%" "10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "ÐžÐ¿Ñ†Ð¸Ñ %s не имеет значений" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "ÐžÐ¿Ñ†Ð¸Ñ %s требует аргументы %d" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "ÐžÐ¿Ñ†Ð¸Ñ %s требует аргумент" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "ÐаÑтройки" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "Сообщение" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 #, fuzzy msgid "Usage:" msgstr "Сообщение" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "ÐаÑтройки" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 #, fuzzy msgid "show this help message and exit" msgstr "Под Ñообщением" Horde_Argv-2.1.0/locale/sk/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000276013102315276017661 0ustar janjanÞ•ŒüHIi‰¨°¶ ½0Ç-ø&&+M&y ŸÀ` ~Ÿ»  Ì×1à1.D(s%œ-     %s option does not take a value%s option requires %d arguments%s option requires an argumentOptionsUsageUsage:[options]option %s: invalid choice: '%s' (choose from %s)option %s: invalid floating-point value: '%s'option %s: invalid integer value: '%s'option %s: invalid long integer value: '%s'show program's version number and exitshow this help message and exitProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2011-02-02 16:17+0100 PO-Revision-Date: 2011-05-18 16:08+0100 Last-Translator: Martin MatuÅ¡ka Language-Team: i18n@lists.horde.org Language: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2; voľba %s neakceptuje hodnotyvoľba %s vyžaduje %d položiekvoľba %s vyžaduje hodnotuVoľbyPoužitiePoužitie:[voľby]voľba %s: neplatná voľba: '%s' (vybraÅ¥ zo %s)voľba %s: neplatná hodnota floating-point: '%s'voľba %s: neplatné prirodzené Äíslo: '%s'voľba %s: neplatné celé Äíslo: '%s'zobraziÅ¥ verziu programu a ukonÄiÅ¥zobraziÅ¥ túto správu s pomocou a ukonÄiÅ¥Horde_Argv-2.1.0/locale/sk/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000440613102315276017663 0ustar janjan# Slovak translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2011-02-02 16:17+0100\n" "PO-Revision-Date: 2011-05-18 16:08+0100\n" "Last-Translator: Martin MatuÅ¡ka \n" "Language-Team: i18n@lists.horde.org\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #: lib/Horde/Argv/Parser.php:495 #, php-format msgid "%s option does not take a value" msgstr "voľba %s neakceptuje hodnoty" #: lib/Horde/Argv/Parser.php:485 lib/Horde/Argv/Parser.php:537 #, php-format msgid "%s option requires %d arguments" msgstr "voľba %s vyžaduje %d položiek" #: lib/Horde/Argv/Parser.php:483 lib/Horde/Argv/Parser.php:535 #, php-format msgid "%s option requires an argument" msgstr "voľba %s vyžaduje hodnotu" #: lib/Horde/Argv/Parser.php:660 msgid "Options" msgstr "Voľby" #: lib/Horde/Argv/TitledHelpFormatter.php:29 msgid "Usage" msgstr "Použitie" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "Použitie:" #: lib/Horde/Argv/Parser.php:186 msgid "[options]" msgstr "[voľby]" #: lib/Horde/Argv/Option.php:122 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "voľba %s: neplatná voľba: '%s' (vybraÅ¥ zo %s)" #: lib/Horde/Argv/Option.php:104 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "voľba %s: neplatná hodnota floating-point: '%s'" #: lib/Horde/Argv/Option.php:94 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "voľba %s: neplatné prirodzené Äíslo: '%s'" #: lib/Horde/Argv/Option.php:95 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "voľba %s: neplatné celé Äíslo: '%s'" #: lib/Horde/Argv/Parser.php:158 msgid "show program's version number and exit" msgstr "zobraziÅ¥ verziu programu a ukonÄiÅ¥" #: lib/Horde/Argv/Parser.php:152 msgid "show this help message and exit" msgstr "zobraziÅ¥ túto správu s pomocou a ukonÄiÅ¥" Horde_Argv-2.1.0/locale/sl/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000100413102315276017650 0ustar janjanÞ•,<PQ Y úOptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3); MožnostiHorde_Argv-2.1.0/locale/sl/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000372513102315276017667 0ustar janjan# Slovenian translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" "%100==4 ? 2 : 3);\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "Možnosti" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "Uporaba KljuÄa " #: lib/Horde/Argv/IndentedHelpFormatter.php:29 #, fuzzy msgid "Usage:" msgstr "Uporaba KljuÄa " #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "Možnosti" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/sv/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000072513102315276017673 0ustar janjanÞ•,<PQlYÆOptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=2; plural=(n != 1); InställningarHorde_Argv-2.1.0/locale/sv/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000365013102315276017676 0ustar janjan# Swedish translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "Inställningar" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "Nyckelanvändande" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 #, fuzzy msgid "Usage:" msgstr "Nyckelanvändande" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "Inställningar" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/tr/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000071313102315276017665 0ustar janjanÞ•,<PQeY ¿OptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=1; plural=0; SeçeneklerHorde_Argv-2.1.0/locale/tr/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000363713102315276017700 0ustar janjan# Turkish translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=1; plural=0;\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "Seçenekler" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "Anahtar Kullanımı" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 #, fuzzy msgid "Usage:" msgstr "Anahtar Kullanımı" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "Seçenekler" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/uk/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000215213102315276017656 0ustar janjanÞ• d ¬àá!@HN U&_¶†0=6n1¥ ×âû G" %s option does not take a value%s option requires %d arguments%s option requires an argumentOptionsUsageUsage:[options]show program's version number and exitProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2013-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2); Ð¾Ð¿Ñ†Ñ–Ñ %s не приймає Ð·Ð½Ð°Ñ‡ÐµÐ½ÑŒÐ¾Ð¿Ñ†Ñ–Ñ %s потребує %d Ð°Ñ€Ð³ÑƒÐ¼ÐµÐ½Ñ‚Ñ–Ð²Ð¾Ð¿Ñ†Ñ–Ñ %s потребує аргументаОпціїВикориÑтаннÑВикориÑтаннÑ:[опції]показати номер верÑÑ–Ñ— програми Ñ– вийтиHorde_Argv-2.1.0/locale/uk/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000430313102315276017661 0ustar janjan# Ukrainian translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2013-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "Ð¾Ð¿Ñ†Ñ–Ñ %s не приймає значень" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "Ð¾Ð¿Ñ†Ñ–Ñ %s потребує %d аргументів" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "Ð¾Ð¿Ñ†Ñ–Ñ %s потребує аргумента" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "Опції" #: lib/Horde/Argv/TitledHelpFormatter.php:29 msgid "Usage" msgstr "ВикориÑтаннÑ" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "ВикориÑтаннÑ:" #: lib/Horde/Argv/Parser.php:199 msgid "[options]" msgstr "[опції]" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "показати номер верÑÑ–Ñ— програми Ñ– вийти" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/zh_CN/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000064213102315276020242 0ustar janjanÞ•,<PQAY›OptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 选项Horde_Argv-2.1.0/locale/zh_CN/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000353713102315276020253 0ustar janjan# Chinese translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "选项" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "密钥语法" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 #, fuzzy msgid "Usage:" msgstr "密钥语法" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "选项" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/zh_TW/LC_MESSAGES/Horde_Argv.mo0000664000175000017500000000064213102315276020274 0ustar janjanÞ•,<PQAY›OptionsProject-Id-Version: Horde_Argv Report-Msgid-Bugs-To: dev@lists.horde.org POT-Creation-Date: 2010-10-13 01:27+0200 PO-Revision-Date: 2010-10-13 01:27+0200 Last-Translator: Automatically generated Language-Team: i18n@lists.horde.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit é¸é …Horde_Argv-2.1.0/locale/zh_TW/LC_MESSAGES/Horde_Argv.po0000664000175000017500000000353713102315276020305 0ustar janjan# Chinese translations for Horde_Argv module. # Copyright 2010-2017 Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv module. # Automatically generated, 2010. # msgid "" msgstr "" "Project-Id-Version: Horde_Argv\n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2010-10-13 01:27+0200\n" "PO-Revision-Date: 2010-10-13 01:27+0200\n" "Last-Translator: Automatically generated\n" "Language-Team: i18n@lists.horde.org\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Argv/Parser.php:507 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:497 lib/Horde/Argv/Parser.php:549 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:495 lib/Horde/Argv/Parser.php:547 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:672 msgid "Options" msgstr "é¸é …" #: lib/Horde/Argv/TitledHelpFormatter.php:29 #, fuzzy msgid "Usage" msgstr "金鑰語法" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 #, fuzzy msgid "Usage:" msgstr "金鑰語法" #: lib/Horde/Argv/Parser.php:199 #, fuzzy msgid "[options]" msgstr "é¸é …" #: lib/Horde/Argv/Option.php:129 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:111 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:101 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:102 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:171 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:165 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/locale/Horde_Argv.pot0000664000175000017500000000345413102315276015647 0ustar janjan# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR Horde LLC (http://www.horde.org/) # This file is distributed under the same license as the Horde_Argv package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: Horde_Argv \n" "Report-Msgid-Bugs-To: dev@lists.horde.org\n" "POT-Creation-Date: 2013-03-05 10:52+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: lib/Horde/Argv/Parser.php:478 #, php-format msgid "%s option does not take a value" msgstr "" #: lib/Horde/Argv/Parser.php:468 lib/Horde/Argv/Parser.php:520 #, php-format msgid "%s option requires %d arguments" msgstr "" #: lib/Horde/Argv/Parser.php:466 lib/Horde/Argv/Parser.php:518 #, php-format msgid "%s option requires an argument" msgstr "" #: lib/Horde/Argv/Parser.php:643 msgid "Options" msgstr "" #: lib/Horde/Argv/TitledHelpFormatter.php:29 msgid "Usage" msgstr "" #: lib/Horde/Argv/IndentedHelpFormatter.php:29 msgid "Usage:" msgstr "" #: lib/Horde/Argv/Parser.php:169 msgid "[options]" msgstr "" #: lib/Horde/Argv/Option.php:122 #, php-format msgid "option %s: invalid choice: '%s' (choose from %s)" msgstr "" #: lib/Horde/Argv/Option.php:104 #, php-format msgid "option %s: invalid floating-point value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:94 #, php-format msgid "option %s: invalid integer value: '%s'" msgstr "" #: lib/Horde/Argv/Option.php:95 #, php-format msgid "option %s: invalid long integer value: '%s'" msgstr "" #: lib/Horde/Argv/Parser.php:141 msgid "show program's version number and exit" msgstr "" #: lib/Horde/Argv/Parser.php:135 msgid "show this help message and exit" msgstr "" Horde_Argv-2.1.0/test/Horde/Argv/AllTests.php0000664000175000017500000000013213102315276017015 0ustar janjanrun(); Horde_Argv-2.1.0/test/Horde/Argv/BoolTest.php0000664000175000017500000000341213102315276017021 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_BoolTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $options = array( $this->makeOption('-v', '--verbose', array('action' => 'store_true', 'dest' => 'verbose', 'default' => '')), $this->makeOption('-q', '--quiet', array('action' => 'store_false', 'dest' => 'verbose')) ); $this->parser = new Horde_Argv_Parser(array('optionList' => $options)); } public function testBoolDefault() { $this->assertParseOk(array(), array('verbose' => ''), array()); } public function testBoolFalse() { list($options, $args) = $this->assertParseOk(array('-q'), array('verbose' => false), array()); $this->assertSame(false, $options->verbose); } public function testBoolTrue() { list($options, $args) = $this->assertParseOk(array('-v'), array('verbose' => true), array()); $this->assertSame(true, $options->verbose); } public function testBoolFlickerOnAndOff() { $this->assertParseOk(array('-qvq', '-q', '-v'), array('verbose' => true), array()); } } Horde_Argv-2.1.0/test/Horde/Argv/bootstrap.php0000664000175000017500000000014313102315276017301 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_CallbackCheckAbbrevTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $this->parser = new Horde_Argv_Parser(); $this->parser->addOption('--foo-bar', array('action' => 'callback', 'callback' => array($this, 'checkAbbrev'))); } public function checkAbbrev($option, $opt, $value, $parser) { $this->assertEquals($opt, '--foo-bar'); } public function testAbbrevCallbackExpansion() { $this->assertParseOk(array('--foo'), array(), array()); } } Horde_Argv-2.1.0/test/Horde/Argv/CallbackExtraArgsTest.php0000664000175000017500000000311413102315276021442 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_CallbackExtraArgsTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $options = array( $this->makeOption('-p', '--point', array('action' => 'callback', 'callback' => array($this, 'processTuple'), 'callbackArgs' => array(3, 'int'), 'type' => 'string', 'dest' => 'points', 'default' => array())), ); $this->parser = new Horde_Argv_Parser(array('optionList' => $options)); } public function processTuple($option, $opt, $value, $parser, $args) { list($len, $type) = $args; $this->assertEquals(3, $len); $this->assertEquals('int', $type); if ($opt == '-p') { $this->assertEquals('1,2,3', $value); } else if ($option == '--point') { $this->assertEquals('4,5,6', $value); } $values = explode(',', $value); foreach ($values as &$value) { settype($value, $type); } $parser->values->{$option->dest}[] = $values; } public function testCallbackExtraArgs() { $this->assertParseOk(array("-p1,2,3", "--point", "4,5,6"), array('points' => array(array(1,2,3), array(4,5,6))), array()); } } Horde_Argv-2.1.0/test/Horde/Argv/CallbackManyArgsTest.php0000664000175000017500000000335213102315276021267 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_CallbackManyArgsTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $options = array( $this->makeOption('-a', '--apple', array('action' => 'callback', 'nargs' => 2, 'callback' => array($this, 'processMany'), 'type' => 'string')), $this->makeOption('-b', '--bob', array('action' => 'callback', 'nargs' => 3, 'callback' => array($this, 'processMany'), 'type' => 'int')) ); $this->parser = new Horde_Argv_Parser(array('optionList' => $options)); } public function processMany($option, $opt, $value, $parser_) { if ($opt == '-a') { $this->assertEquals(array('foo', 'bar'), $value); } else if ($opt == '--apple') { $this->assertEquals(array('ding', 'dong'), $value); } else if ($opt == '-b') { $this->assertEquals(array(1, 2, 3), $value); } else if ($option == '--bob') { $this->assertEquals(array(-666, 42, 0), $value); } } public function testManyArgs() { $this->assertParseOk(array("-a", "foo", "bar", "--apple", "ding", "dong", "-b", "1", "2", "3", "--bob", "-666", "42", "0"), array('apple' => null, 'bob' => null), array()); } } Horde_Argv-2.1.0/test/Horde/Argv/CallbackMeddleArgsTest.php0000664000175000017500000000347013102315276021556 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_CallbackMeddleArgsTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $options = array(); for ($i = -1; $i > -6; $i--) { $options[] = $this->makeOption((string)$i, array('action' => 'callback', 'callback' => array($this, 'process_n'), 'dest' => 'things')); } $this->parser = new Horde_Argv_Parser(array('optionList' => $options)); } /** * Callback that meddles in rargs, largs */ public function process_n($option, $opt, $value, $parser) { // option is -3, -5, etc. $nargs = (int)substr($opt, 1); $rargs =& $parser->rargs; if (count($rargs) < $nargs) { $this->fail(sprintf("Expected %d arguments for %s option.", $nargs, $opt)); } $parser->values->{$option->dest}[] = array_splice($rargs, 0, $nargs); $parser->largs[] = $nargs; } public function testCallbackMeddleArgs() { $this->assertParseOK(array("-1", "foo", "-3", "bar", "baz", "qux"), array('things' => array(array('foo'), array('bar', 'baz', 'qux'))), array(1, 3)); } public function testCallbackMeddleArgsSeparator() { $this->assertParseOK(array("-2", "foo", "--"), array('things' => array(array('foo', '--'))), array(2)); } } Horde_Argv-2.1.0/test/Horde/Argv/CallbackTest.php0000664000175000017500000000611613102315276017626 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_CallbackTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $options = array( new Horde_Argv_Option('-x', null, array('action' => 'callback', 'callback' => array($this, 'processOpt'))), new Horde_Argv_Option('-f', '--file', array('action' => 'callback', 'callback' => array($this, 'processOpt'), 'type' => 'string', 'dest' => 'filename')), ); $this->parser = new Horde_Argv_Parser(array('optionList' => $options)); } public function processOpt($option, $opt, $value, $parser_) { if ($opt == '-x') { $this->assertEquals(array('-x'), $option->shortOpts); $this->assertEquals(array(), $option->longOpts); $this->assertInstanceOf(get_class($this->parser), $parser_); $this->assertNull($value); $this->assertEquals(array('filename' => null), iterator_to_array($parser_->values)); $parser_->values->x = 42; } else if ($opt == '--file') { $this->assertEquals(array('-f'), $option->shortOpts); $this->assertEquals(array('--file'), $option->longOpts); $this->assertInstanceOf(get_class($this->parser), $parser_); $this->assertEquals('foo', $value); $this->assertEquals(array('filename' => null, 'x' => 42), iterator_to_array($parser_->values)); $parser_->values->{$option->dest} = $value; } else { $this->fail(sprintf('Unknown option %r in processOpt.', $opt)); } } public function testCallback() { $this->assertParseOk(array('-x', '--file=foo'), array('filename' => 'foo', 'x' => 42), array()); } public function testCallbackHelp() { // This test was prompted by SF bug #960515 -- the point is not to // inspect the help text, just to make sure that formatHelp() doesn't // crash. $parser = new Horde_Argv_Parser(array( 'usage' => Horde_Argv_Option::SUPPRESS_USAGE, 'formatter' => new Horde_Argv_IndentedHelpFormatter( 2, 24, null, true, new Horde_Cli_Color(Horde_Cli_Color::FORMAT_NONE) ) )); $parser->removeOption('-h'); $parser->addOption( '-t', '--test', array( 'action' => 'callback', 'callback' => array($this, 'returnNull'), 'type' => 'string', 'help' => 'foo' ) ); $expectedHelp = "Options:\n -t TEST, --test=TEST foo\n"; $this->assertHelp($parser, $expectedHelp); } public function returnNull() { } } Horde_Argv-2.1.0/test/Horde/Argv/CallbackVarArgsTest.php0000664000175000017500000000540513102315276021114 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_CallbackVarArgsTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $options = array( $this->makeOption('-a', array('type' => 'int', 'nargs' => 2, 'dest' => 'a')), $this->makeOption('-b', array('action' => 'store_true', 'dest' => 'b')), $this->makeOption('-c', '--callback', array('action' => 'callback', 'callback' => array($this, 'variableArgs'), 'dest' => 'c')), ); $this->parser = new Horde_Argv_InterceptingParser(array('usage' => Horde_Argv_Option::SUPPRESS_USAGE, 'optionList' => $options)); } public function variableArgs($option, $opt, $value, $parser) { $this->assertNull($value); $done = 0; $value = array(); $rargs =& $parser->rargs; while ($rargs) { $arg = $rargs[0]; if ((substr($arg, 0, 2) == '--' && strlen($arg) > 2) || (substr($arg, 0, 1) == '-' && strlen($arg) > 1 && substr($arg, 1, 1) != '-')) { break; } else { $value[] = $arg; array_shift($rargs); } } $parser->values->{$option->dest} = $value; } public function testVariableArgs() { $this->assertParseOK(array('-a3', '-5', '--callback', 'foo', 'bar'), array('a' => array(3, -5), 'b' => null, 'c' => array('foo', 'bar')), array()); } public function testConsumeSeparatorStopAtOption() { $this->assertParseOK(array('-c', '37', '--', 'xxx', '-b', 'hello'), array('a' => null, 'b' => true, 'c' => array('37', '--', 'xxx')), array('hello')); } public function testPositionalArgAndVariableArgs() { $this->assertParseOK(array('hello', '-c', 'foo', '-', 'bar'), array('a' => null, 'b' => null, 'c' => array('foo', '-', 'bar')), array('hello')); } public function testStopAtOption() { $this->assertParseOK(array('-c', 'foo', '-b'), array('a' => null, 'b' => true, 'c' => array('foo')), array()); } public function testStopAtInvalidOption() { $this->assertParseFail(array('-c', '3', '-5', '-a'), 'no such option: -5'); } } Horde_Argv-2.1.0/test/Horde/Argv/ChoiceTest.php0000664000175000017500000000267313102315276017330 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_ChoiceTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $this->parser = new Horde_Argv_InterceptingParser(array('usage' => Horde_Argv_Option::SUPPRESS_USAGE)); $this->parser->addOption('-c', array('action' => 'store', 'type' => 'choice', 'dest' => 'choice', 'choices' => array('one', 'two', 'three'))); } public function testValidChoice() { $this->assertParseOk(array('-c', 'one', 'xyz'), array('choice' => 'one'), array('xyz')); } public function testInvalidChoice() { $this->assertParseFail(array('-c', 'four', 'abc'), "option -c: invalid choice: 'four' " . "(choose from 'one', 'two', 'three')"); } public function testAddChoiceOption() { $this->parser->addOption('-d', '--default', array('choices' => array('four', 'five', 'six'))); $opt = $this->parser->getOption('-d'); $this->assertEquals('choice', $opt->type); $this->assertEquals('store', $opt->action); } } Horde_Argv-2.1.0/test/Horde/Argv/ConflictingDefaultsTest.php0000664000175000017500000000240113102315276022052 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ /** * Conflicting default values: the last one should win. */ class Horde_Argv_ConflictingDefaultsTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $options = array( $this->makeOption('-v', array('action' => 'store_true', 'dest' => 'verbose', 'default' => 1)) ); $this->parser = new Horde_Argv_Parser(array('optionList' => $options)); } public function testConflictDefault() { $this->parser->addOption('-q', array('action' => 'store_false', 'dest' => 'verbose', 'default' => 0)); $this->assertParseOk(array(), array('verbose' => 0), array()); } public function testConflictDefaultNone() { $this->parser->addOption('-q', array('action' => 'store_false', 'dest' => 'verbose', 'default' => null)); $this->assertParseOk(array(), array('verbose' => null), array()); } } Horde_Argv-2.1.0/test/Horde/Argv/ConflictOverrideTest.php0000664000175000017500000000367113102315276021376 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_ConflictOverrideTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $this->parser = new Horde_Argv_InterceptingParser(array( 'usage' => Horde_Argv_Option::SUPPRESS_USAGE, 'formatter' => new Horde_Argv_IndentedHelpFormatter( 2, 24, null, true, new Horde_Cli_Color(Horde_Cli_Color::FORMAT_NONE) ) )); $this->parser->setConflictHandler('resolve'); $this->parser->addOption( '-n', '--dry-run', array( 'action' => 'store_true', 'dest' => 'dry_run', 'help' => "don't do anything" ) ); $this->parser->addOption( '--dry-run', '-n', array( 'action' => 'store_const', 'const' => 42, 'dest' => 'dry_run', 'help' => 'dry run mode' ) ); } public function testConflictOverrideOpts() { $opt = $this->parser->getOption('--dry-run'); $this->assertEquals(array('-n'), $opt->shortOpts); $this->assertEquals(array('--dry-run'), $opt->longOpts); } public function testConflictOverrideHelp() { $output = "Options:\n" . " -h, --help show this help message and exit\n" . " -n, --dry-run dry run mode\n"; $this->assertOutput(array('-h'), $output); } public function testConflictOverrideArgs() { $this->assertParseOk(array('-n'), array('dry_run' => 42), array()); } } Horde_Argv-2.1.0/test/Horde/Argv/ConflictResolveTest.php0000664000175000017500000000453413102315276021235 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_ConflictResolveTest extends Horde_Argv_ConflictTestCase { public function setUp() { parent::setUp(); $this->parser->setConflictHandler('resolve'); $this->parser->addOption('-v', '--version', array('action' => 'callback', 'callback' => array($this, 'showVersion'), 'help' => 'show version')); } public function testConflictResolve() { $vOpt = $this->parser->getOption('-v'); $verboseOpt = $this->parser->getOption('--verbose'); $versionOpt = $this->parser->getOption('--version'); $this->assertSame($vOpt, $versionOpt); $this->assertNotSame($vOpt, $verboseOpt); $this->assertEquals(array('--version'), $vOpt->longOpts); $this->assertEquals(array('-v'), $versionOpt->shortOpts); $this->assertEquals(array('--version'), $versionOpt->longOpts); $this->assertEquals(array(), $verboseOpt->shortOpts); $this->assertEquals(array('--verbose'), $verboseOpt->longOpts); } public function testConflictResolveHelp() { $output = "Options:\n" . " --verbose increment verbosity\n" . " -h, --help show this help message and exit\n" . " -v, --version show version\n"; $this->assertOutput(array('-h'), $output); } public function testConflictResolveShortOpt() { $this->assertParseOk(array('-v'), array('verbose' => null, 'showVersion' => 1), array()); } public function testConflictResolveLongOpt() { $this->assertParseOk(array('--verbose'), array('verbose' => 1), array()); } public function testConflictResolveLongOpts() { $this->assertParseOk(array('--verbose', '--version'), array('verbose' => 1, 'showVersion' => 1), array()); } } Horde_Argv-2.1.0/test/Horde/Argv/ConflictTest.php0000664000175000017500000000267013102315276017674 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_ConflictTest extends Horde_Argv_ConflictTestCase { public function assertConflictError($func) { try { call_user_func($func, '-v', '--version', array( 'action' => 'callback', 'callback' => array($this, 'showVersion'), 'help' => 'show version')); $this->fail(); } catch (Horde_Argv_OptionConflictException $e) { $this->assertEquals("option -v/--version: conflicting option string(s): -v", $e->getMessage()); $this->assertEquals('-v/--version', $e->optionId); } } public function testConflictError() { $this->assertConflictError(array($this->parser, 'addOption')); } public function testConflictErrorGroup() { $group = new Horde_Argv_OptionGroup($this->parser, 'Group 1'); $this->assertConflictError(array($group, 'addOption')); } public function testNoSuchConflictHandler() { $this->assertRaises(array($this->parser, 'setConflictHandler'), array('foo'), 'InvalidArgumentException', "invalid conflictHandler 'foo'"); } } Horde_Argv-2.1.0/test/Horde/Argv/ConflictTestCase.php0000664000175000017500000000177313102315276020473 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_ConflictTestCase extends Horde_Argv_TestCase { public function setUp() { $options = array(new Horde_Argv_Option('-v', '--verbose', array( 'action' => 'count', 'dest' => 'verbose', 'help' => 'increment verbosity')) ); $this->parser = new Horde_Argv_InterceptingParser(array( 'usage' => Horde_Argv_Option::SUPPRESS_USAGE, 'optionList' => $options, 'formatter' => new Horde_Argv_IndentedHelpFormatter( 2, 24, null, true, new Horde_Cli_Color(Horde_Cli_Color::FORMAT_NONE) ) )); } public function showVersion($option, $opt, $value, $parser) { $this->parser->values->showVersion = 1; } } Horde_Argv-2.1.0/test/Horde/Argv/CountTest.php0000664000175000017500000000607213102315276017223 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_CountTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $this->parser = new Horde_Argv_InterceptingParser(array('usage' => Horde_Argv_Option::SUPPRESS_USAGE)); $this->vOpt = $this->makeOption('-v', array('action' => 'count', 'dest' => 'verbose')); $this->parser->addOption($this->vOpt); $this->parser->addOption('--verbose', array('type' => 'int', 'dest' => 'verbose')); $this->parser->addOption('-q', '--quiet', array('action' => 'store_const', 'dest' => 'verbose', 'const' => 0)); } public function testEmpty() { $this->assertParseOk(array(), array('verbose' => null), array()); } public function testCountOne() { $this->assertParseOk(array('-v'), array('verbose' => 1), array()); } public function testCountThree() { $this->assertParseOk(array('-vvv'), array('verbose' => 3), array()); } public function testCountThreeApart() { $this->assertParseOk(array('-v', '-v', '-v'), array('verbose' => 3), array()); } public function testCountOverrideAmount() { $this->assertParseOk(array('-vvv', '--verbose=2'), array('verbose' => 2), array()); } public function testCountOverrideQuiet() { $this->assertParseOk(array('-vvv', '--verbose=2', '-q'), array('verbose' => 0), array()); } public function testCountOverriding() { $this->assertParseOk(array('-vvv', '--verbose=2', '-q', '-v'), array('verbose' => 1), array()); } public function testCountInterspersedArgs() { $this->assertParseOk(array('--quiet', '3', '-v'), array('verbose' => 1), array('3')); } public function testCountNoInterspersedArgs() { $this->parser->disableInterspersedArgs(); $this->assertParseOk(array('--quiet', '3', '-v'), array('verbose' => 0), array('3', '-v')); } public function testCountNoSuchOption() { $this->assertParseFail(array('-q3', '-v'), 'no such option: -3'); } public function testCountOptionNoValue() { $this->assertParseFail(array('--quiet=3', 'v'), '--quiet option does not take a value'); } public function testCountWithDefault() { $this->parser->setDefault('verbose', 0); $this->assertParseOk(array(), array('verbose' => 0), array()); } public function testCountOverridingDefault() { $this->parser->setDefault('verbose', 0); $this->assertParseOk(array('-vvv', '--verbose=2', '-q', '-v'), array('verbose' => 1), array()); } } Horde_Argv-2.1.0/test/Horde/Argv/DefaultValuesTest.php0000664000175000017500000000774213102315276020704 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_DefaultValuesTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $this->parser = new Horde_Argv_Parser(); $this->parser->addOption('-v', '--verbose', array('default' => true)); $this->parser->addOption('-q', '--quiet', array('dest' => 'verbose')); $this->parser->addOption('-n', array('type' => 'int', 'default' => 37)); $this->parser->addOption('-m', array('type' => 'int')); $this->parser->addOption('-s', array('default' => 'foo')); $this->parser->addOption('-t'); $this->parser->addOption('-u', array('default' => null)); $this->expected = array('verbose' => true, 'n' => 37, 'm' => null, 's' => 'foo', 't' => null, 'u' => null); } public function testBasicDefault() { $this->assertEquals($this->expected, iterator_to_array($this->parser->getDefaultValues())); } public function testMixedDefaultsPost() { $this->parser->setDefaults(array('n' => 42, 'm' => -100)); $this->expected = array_merge($this->expected, array('n' => 42, 'm' => -100)); $this->assertEquals($this->expected, iterator_to_array($this->parser->getDefaultValues())); } public function testMixedDefaultsPre() { $this->parser->setDefaults(array('x' => 'barf', 'y' => 'blah')); $this->parser->addOption('-x', array('default' => 'frob')); $this->parser->addOption('-y'); $this->expected = array_merge($this->expected, array('x' => 'frob', 'y' => 'blah')); $this->assertEquals($this->expected, iterator_to_array($this->parser->getDefaultValues())); $this->parser->removeOption('-y'); $this->parser->addOption('-y', array('default' => null)); $this->expected = array_merge($this->expected, array('y' => null)); $this->assertEquals($this->expected, iterator_to_array($this->parser->getDefaultValues())); } public function testProcessDefault() { $this->parser->optionClass = 'Horde_Argv_DurationOption'; $this->parser->addOption('-d', array('type' => 'duration', 'default' => 300)); $this->parser->addOption('-e', array('type' => 'duration', 'default' => '6m')); $this->parser->setDefaults(array('n' => '42')); $this->expected = array_merge($this->expected, array('d' => 300, 'e' => 360, 'n' => '42')); $this->assertEquals($this->expected, iterator_to_array($this->parser->getDefaultValues())); } } class Horde_Argv_DurationOption extends Horde_Argv_Option { public $TYPES = array('string', 'int', 'long', 'float', 'complex', 'choice', 'duration'); public $TYPE_CHECKER = array('int' => 'checkBuiltin', 'long' => 'checkBuiltin', 'float' => 'checkBuiltin', 'complex'=> 'checkBuiltin', 'choice' => 'checkChoice', 'duration' => 'checkDuration', ); public function checkDuration($opt, $value) { // Custom type for testing processing of default values. $time_units = array('s' => 1, 'm' => 60, 'h' => 60 * 60, 'd' => 60 * 60 * 24); $last = substr($value, -1); if (is_numeric($last)) { return (int)$value; } elseif (isset($time_units[$last])) { return (int)substr($value, 0, -1) * $time_units[$last]; } else { throw new Horde_Argv_OptionValueException(sprintf( 'option %s: invalid duration: %s', $opt, $value)); } } } Horde_Argv-2.1.0/test/Horde/Argv/ExpandDefaultsTest.php0000664000175000017500000001002213102315276021030 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_ExpandDefaultsTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $this->parser = new Horde_Argv_Parser(array( 'prog' => 'test', 'formatter' => new Horde_Argv_IndentedHelpFormatter( 2, 24, null, true, new Horde_Cli_Color(Horde_Cli_Color::FORMAT_NONE) ) )); $this->help_prefix = 'Usage: test [options] Options: -h, --help show this help message and exit'; $this->file_help = "read from FILE [default: %default]"; $this->expected_help_file = $this->help_prefix . "\n" . " -f FILE, --file=FILE read from FILE [default: foo.txt]\n"; $this->expected_help_none = $this->help_prefix . "\n" . " -f FILE, --file=FILE read from FILE [default: none]\n"; } public function testOptionDefault() { $this->parser->addOption("-f", "--file", array('default' => 'foo.txt', 'help' => $this->file_help)); $this->assertHelp($this->parser, $this->expected_help_file); } public function testParserDefault1() { $this->parser->addOption("-f", "--file", array('help' => $this->file_help)); $this->parser->setDefault('file', "foo.txt"); $this->assertHelp($this->parser, $this->expected_help_file); } public function testParserDefault2() { $this->parser->addOption("-f", "--file", array('help' => $this->file_help)); $this->parser->setDefaults(array('file' => 'foo.txt')); $this->assertHelp($this->parser, $this->expected_help_file); } public function testNoDefault() { $this->parser->addOption("-f", "--file", array('help' => $this->file_help)); $this->assertHelp($this->parser, $this->expected_help_none); } public function testDefaultNone1() { $this->parser->addOption("-f", "--file", array('default' => null, 'help' => $this->file_help)); $this->assertHelp($this->parser, $this->expected_help_none); } public function testDefaultNone2() { $this->parser->addOption("-f", "--file", array('help' => $this->file_help)); $this->parser->setDefaults(array('file' => null)); $this->assertHelp($this->parser, $this->expected_help_none); } public function testFloatDefault() { $this->parser->addOption( "-p", "--prob", array('help' => "blow up with probability PROB [default: %default]")); $this->parser->setDefaults(array('prob' => 0.43)); $expected_help = $this->help_prefix . "\n" . " -p PROB, --prob=PROB blow up with probability PROB [default: 0.43]\n"; $this->assertHelp($this->parser, $expected_help); } public function testAltExpand() { $this->parser->addOption("-f", "--file", array('default' => "foo.txt", 'help' => "read from FILE [default: *DEFAULT*]")); $this->parser->formatter->default_tag = "*DEFAULT*"; $this->assertHelp($this->parser, $this->expected_help_file); } public function testNoExpand() { $this->parser->addOption("-f", "--file", array('default' => "foo.txt", 'help' => "read from %default file")); $this->parser->formatter->default_tag = null; $expected_help = $this->help_prefix . "\n" . " -f FILE, --file=FILE read from %default file\n"; $this->assertHelp($this->parser, $expected_help); } } Horde_Argv-2.1.0/test/Horde/Argv/ExtendAddActionsTest.php0000664000175000017500000000504513102315276021313 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_ExtendAddActionsTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $options = array(new Horde_Argv_ExtendAddActionsTest_MyOption("-a", "--apple", array( 'action' => "extend", 'type' => "string", 'dest' => "apple"))); $this->parser = new Horde_Argv_Parser(array('optionList' => $options)); } public function testExtendAddAction() { $this->assertParseOK(array("-afoo,bar", "--apple=blah"), array('apple' => array("foo", "bar", "blah")), array()); } public function testExtendAddActionNormal() { $this->assertParseOK(array("-a", "foo", "-abar", "--apple=x,y"), array('apple' => array("foo", "bar", "x", "y")), array()); } } class Horde_Argv_ExtendAddActionsTest_MyOption extends Horde_Argv_Option { public $ACTIONS = array("store", "store_const", "store_true", "store_false", "append", "append_const", "count", "callback", "help", "version", "extend", ); public $STORE_ACTIONS = array("store", "store_const", "store_true", "store_false", "append", "append_const", "count", "extend", ); public $TYPED_ACTIONS = array("store", "append", "callback", "extend", ); public function takeAction($action, $dest, $opt, $value, $values, $parser) { if ($action == "extend") { $lvalue = explode(',', $value); $values->$dest = array_merge($values->ensureValue($dest, array()), $lvalue); } else { parent::takeAction($action, $dest, $opt, $parser, $value, $values); } } } Horde_Argv-2.1.0/test/Horde/Argv/ExtendAddTypesTest.php0000664000175000017500000000537013102315276021020 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_ExtendAddTypesTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $this->parser = new Horde_Argv_InterceptingParser(array('usage' => Horde_Argv_Option::SUPPRESS_USAGE, 'optionClass' => 'Horde_Argv_ExtendAddTypesTest_MyOption')); $this->parser->addOption("-a", null, array('type' => "string", 'dest' => "a")); $this->parser->addOption("-f", "--file", array('type' => "file", 'dest' => "file")); /* @todo make more system independent */ $this->testPath = tempnam('/tmp', 'horde_argv'); } public function tearDown() { if (!is_link($this->testPath) && is_dir($this->testPath)) { rmdir($this->testPath); } elseif (is_file($this->testPath)) { unlink($this->testPath); } } public function testFiletypeOk() { touch($this->testPath); $this->assertParseOK(array("--file", $this->testPath, "-afoo"), array('file' => $this->testPath, 'a' => 'foo'), array()); } public function testFiletypeNoexist() { unlink($this->testPath); $this->assertParseFail(array("--file", $this->testPath, "-afoo"), sprintf("%s: file does not exist", $this->testPath)); } public function testFiletypeNotfile() { unlink($this->testPath); mkdir($this->testPath); $this->assertParseFail(array("--file", $this->testPath, "-afoo"), sprintf("%s: not a regular file", $this->testPath)); } } class Horde_Argv_ExtendAddTypesTest_MyOption extends Horde_Argv_Option { public $TYPES = array('string', 'int', 'long', 'float', 'complex', 'choice', 'file'); public $TYPE_CHECKER = array("int" => 'checkBuiltin', "long" => 'checkBuiltin', "float" => 'checkBuiltin', "complex"=> 'checkBuiltin', "choice" => 'checkChoice', 'file' => 'checkFile', ); public function checkFile($opt, $value) { if (!file_exists($value)) { throw new Horde_Argv_OptionValueException(sprintf("%s: file does not exist", $value)); } elseif (!is_file($value)) { throw new Horde_Argv_OptionValueException(sprintf("%s: not a regular file", $value)); } return $value; } } Horde_Argv-2.1.0/test/Horde/Argv/HelpTest.php0000664000175000017500000001642613102315276017027 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_HelpTest extends Horde_Argv_TestCase { public static $expected_help_basic = 'Usage: bar.php [options] Options: -a APPLE throw APPLEs at basket -b NUM, --boo=NUM shout "boo!" NUM times (in order to frighten away all the evil spirits that cause trouble and mayhem) --foo=FOO store FOO in the foo list for later fooing -h, --help show this help message and exit '; public static $expected_help_long_opts_first = 'Usage: bar.php [options] Options: -a APPLE throw APPLEs at basket --boo=NUM, -b NUM shout "boo!" NUM times (in order to frighten away all the evil spirits that cause trouble and mayhem) --foo=FOO store FOO in the foo list for later fooing --help, -h show this help message and exit '; public static $expected_help_title_formatter = 'Usage ===== bar.php [options] Options ======= -a APPLE throw APPLEs at basket -b NUM, --boo=NUM shout "boo!" NUM times (in order to frighten away all the evil spirits that cause trouble and mayhem) --foo=FOO store FOO in the foo list for later fooing -h, --help show this help message and exit '; public static $expected_help_short_lines = 'Usage: bar.php [options] Options: -a APPLE throw APPLEs at basket -b NUM, --boo=NUM shout "boo!" NUM times (in order to frighten away all the evil spirits that cause trouble and mayhem) --foo=FOO store FOO in the foo list for later fooing -h, --help show this help message and exit '; public function setUp() { parent::setUp(); $this->parser = $this->makeParser(80); $this->origColumns = getenv('COLUMNS'); if (!isset($_SERVER['argv'])) { $_SERVER['argv'] = array('test'); } } public function tearDown() { putenv('COLUMNS=' . $this->origColumns); unset($_SERVER['argv']); } public function makeParser($columns) { $options = array( $this->makeOption( "-a", array( 'type' => "string", 'dest' => 'a', 'metavar' => "APPLE", 'help' => "throw APPLEs at basket" ) ), $this->makeOption( "-b", "--boo", array( 'type' => "int", 'dest' => 'boo', 'metavar' => "NUM", 'help' => "shout \"boo!\" NUM times (in order to frighten away " . "all the evil spirits that cause trouble and mayhem)" ) ), $this->makeOption( "--foo", array( 'action' => 'append', 'type' => 'string', 'dest' => 'foo', 'help' => "store FOO in the foo list for later fooing" ) ), ); putenv('COLUMNS=' . $columns); return new Horde_Argv_InterceptingParser(array( 'optionList' => $options, 'formatter' => new Horde_Argv_IndentedHelpFormatter( 2, 24, null, true, new Horde_Cli_Color(Horde_Cli_Color::FORMAT_NONE) ) )); } public function assertHelpEquals($expectedOutput) { // @todo // if type(expected_output) is types.UnicodeType: // encoding = self.parser._get_encoding(sys.stdout) // expected_output = expected_output.encode(encoding, "replace") $origArgv = $_SERVER['argv']; $_SERVER['argv'][0] = 'foo/bar.php'; $this->assertOutput(array('-h'), $expectedOutput); $_SERVER['argv'] = $origArgv; } public function testHelp() { $this->assertHelpEquals(self::$expected_help_basic); } public function tesHelpOldUsage() { $this->parser->setUsage("Usage: %prog [options]"); $this->assertHelpEquals(self::$expected_help_basic); } public function testHelpLongOptsFirst() { $this->parser->formatter->short_first = false; $this->assertHelpEquals(self::$expected_help_long_opts_first); } public function testHelpTitleFormatter() { $this->parser->formatter = new Horde_Argv_TitledHelpFormatter( 0, 24, null, true, new Horde_Cli_Color(Horde_Cli_Color::FORMAT_NONE) ); $this->assertHelpEquals(self::$expected_help_title_formatter); } public function testWrapColumns() { // Ensure that wrapping respects $COLUMNS environment variable. // Need to reconstruct the parser, since that's the only time // we look at $COLUMNS. $this->parser = $this->makeParser(60); $this->assertHelpEquals(self::$expected_help_short_lines); } public function testHelpDescriptionGroups() { $this->parser->setDescription( "This is the program description for %prog. %prog has " . "an option group as well as single options."); $group = new Horde_Argv_OptionGroup( $this->parser, "Dangerous Options", "Caution: use of these options is at your own risk. " . "It is believed that some of them bite."); $group->addOption("-g", array('action' => "store_true", 'help' => "Group option.")); $this->parser->addOptionGroup($group); $expect = 'Usage: bar.php [options] This is the program description for bar.php. bar.php has an option group as well as single options. Options: -a APPLE throw APPLEs at basket -b NUM, --boo=NUM shout "boo!" NUM times (in order to frighten away all the evil spirits that cause trouble and mayhem) --foo=FOO store FOO in the foo list for later fooing -h, --help show this help message and exit Dangerous Options: Caution: use of these options is at your own risk. It is believed that some of them bite. -g Group option. '; $this->assertHelpEquals($expect); $this->parser->epilog = "Please report bugs to /dev/null."; $this->assertHelpEquals($expect . "\nPlease report bugs to /dev/null.\n"); } /* @todo def test_help_unicode(self): self.parser = Horde_Argv_InterceptingParser(usage=Horde_Argv_Option::SUPPRESS_USAGE) self.parser.addOption("-a", action="store_true", help=u"ol\u00E9!") expect = u"""\ Options: -h, --help show this help message and exit -a ol\u00E9! """ self.assertHelpEquals(expect) def test_help_unicode_description(self): self.parser = Horde_Argv_InterceptingParser(usage=Horde_Argv_Option::SUPPRESS_USAGE, description=u"ol\u00E9!") expect = u"""\ ol\u00E9! Options: -h, --help show this help message and exit """ self.assertHelpEquals(expect) */ } Horde_Argv-2.1.0/test/Horde/Argv/InterceptedException.php0000664000175000017500000000140513102315276021413 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_InterceptedException extends Exception { public function __construct($error_message = null, $exit_status = null, $exit_message = null) { $this->error_message = $error_message; $this->exit_status = $exit_status; $this->exit_message = $exit_message; } public function __toString() { if ($this->error_message) return $this->error_message; if ($this->exit_message) return $this->exit_message; return "intercepted error"; } } Horde_Argv-2.1.0/test/Horde/Argv/InterceptingParser.php0000664000175000017500000000113713102315276021100 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_InterceptingParser extends Horde_Argv_Parser { public function parserExit($status = 0, $msg = null) { throw new Horde_Argv_InterceptedException(null, $status, $msg); } public function parserError($msg) { throw new Horde_Argv_InterceptedException($msg); } } Horde_Argv-2.1.0/test/Horde/Argv/MatchAbbrevTest.php0000664000175000017500000000205513102315276020306 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_MatchAbbrevTest extends Horde_Argv_TestCase { public function testMatchAbbrev() { $this->assertEquals(Horde_Argv_Parser::matchAbbrev("--f", array("--foz" => null, "--foo" => null, "--fie" => null, "--f" => null)), '--f'); } public function testMatchAbbrevError() { $s = '--f'; $wordmap = array("--foz" => null, "--foo" => null, "--fie" => null); try { Horde_Argv_Parser::matchAbbrev($s, $wordmap); $this->fail(); } catch (Horde_Argv_BadOptionException $e) { $this->assertEquals("ambiguous option: --f (--fie, --foo, --foz?)", $e->getMessage()); } } } Horde_Argv-2.1.0/test/Horde/Argv/MultipleArgsAppendTest.php0000664000175000017500000000356513102315276021677 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_MultipleArgsAppendTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $this->parser = new Horde_Argv_InterceptingParser(array('usage' => Horde_Argv_Option::SUPPRESS_USAGE)); $this->parser->addOption("-p", "--point", array( 'action' => "store", 'nargs' => 3, 'type' => 'float', 'dest' => 'point')); $this->parser->addOption("-f", "--foo", array( 'action' => "append", 'nargs' => 2, 'type' => "int", 'dest' => "foo")); $this->parser->addOption("-z", "--zero", array( 'action' => "append_const", 'dest' => "foo", 'const' => array(0, 0))); } public function testNargsAppend() { $this->assertParseOK(array("-f", "4", "-3", "blah", "--foo", "1", "666"), array('point' => null, 'foo' => array(array(4, -3), array(1, 666))), array('blah')); } public function testNargsAppendRequiredValues() { $this->assertParseFail(array("-f4,3"), "-f option requires 2 arguments"); } public function testNargsAppendSimple() { $this->assertParseOK(array("--foo=3", "4"), array('point' => null, 'foo' => array(array(3, 4))), array()); } public function testNargsAppendConst() { $this->assertParseOK(array("--zero", "--foo", "3", "4", "-z"), array('point' => null, 'foo' => array(array(0, 0), array(3, 4), array(0, 0))), array()); } } Horde_Argv-2.1.0/test/Horde/Argv/MultipleArgsTest.php0000664000175000017500000000306313102315276020540 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_MultipleArgsTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $this->parser = new Horde_Argv_InterceptingParser(array('usage' => Horde_Argv_Option::SUPPRESS_USAGE)); $this->parser->addOption("-p", "--point", array('action' => "store", 'nargs' => 3, 'type' => "float", 'dest' => "point")); } public function testNargsWithPositionalArgs() { $this->assertParseOK(array("foo", "-p", "1", "2.5", "-4.3", "xyz"), array('point' => array(1.0, 2.5, -4.3)), array('foo', 'xyz')); } public function testNargsLongOpt() { $this->assertParseOK(array("--point", "-1", "2.5", "-0", "xyz"), array('point' => array(-1.0, 2.5, -0.0)), array("xyz")); } public function testNargsInvalidFloatValue() { $this->assertParseFail(array("-p", "1.0", "2x", "3.5"), "option -p: invalid floating-point value: '2x'"); } public function testNargsRequiredValues() { $this->assertParseFail(array("--point", "1.0", "3.5"), "--point option requires 3 arguments"); } } Horde_Argv-2.1.0/test/Horde/Argv/OptionChecksTest.php0000664000175000017500000001167713102315276020533 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_OptionChecksTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $this->parser = new Horde_Argv_Parser(array('usage' => Horde_Argv_Option::SUPPRESS_USAGE)); } public function assertOptionError($expected_message, $args) { $this->assertRaises(array($this, 'makeOption'), $args, 'Horde_Argv_OptionException', $expected_message); } public function testOptStringEmpty() { try { new Horde_Argv_Option(); } catch (Exception $e) { $this->assertInstanceOf('InvalidArgumentException', $e); $this->assertEquals("at least one option string must be supplied", $e->getMessage()); return true; } $this->fail("InvalidArgumentException for no option strings not thrown"); } public function testOptStringTooShort() { $this->assertOptionError( "invalid option string 'b': must be at least two characters long", array("b")); } public function testOptStringShortInvalid() { $this->assertOptionError( "invalid short option string '--': must be " . "of the form -x, (x any non-dash char)", array("--")); } public function testOptStringLongInvalid() { $this->assertOptionError( "invalid long option string '---': " . "must start with --, followed by non-dash", array("---")); } public function testAttrInvalid() { $this->assertOptionError( "option -b: invalid keyword arguments: bar, foo", array("-b", array('foo' => null, 'bar' => null))); } public function testActionInvalid() { $this->assertOptionError( "option -b: invalid action: 'foo'", array("-b", array('action' => 'foo'))); } public function testTypeInvalid() { $this->assertOptionError( "option -b: invalid option type: 'foo'", array("-b", array('type' => 'foo'))); } public function testNoTypeForAction() { $this->assertOptionError( "option -b: must not supply a type for action 'count'", array("-b", array('action' => 'count', 'type' => 'int'))); } public function testNoChoicesList() { $this->assertOptionError( "option -b/--bad: must supply a list of " . "choices for type 'choice'", array("-b", "--bad", array('type' => "choice"))); } public function testBadChoicesList() { $typename = gettype(''); $this->assertOptionError( sprintf("option -b/--bad: choices must be a list of " . "strings ('%s' supplied)", $typename), array("-b", "--bad", array('type' => 'choice', 'choices' => 'bad choices'))); } public function testNoChoicesForType() { $this->assertOptionError( "option -b: must not supply choices for type 'int'", array("-b", array('type' => 'int', 'choices' => "bad"))); } public function testNoConstForAction() { $this->assertOptionError( "option -b: 'const' must not be supplied for action 'store'", array("-b", array('action' => 'store', 'const' => 1))); } public function testNoNargsForAction() { $this->assertOptionError( "option -b: 'nargs' must not be supplied for action 'count'", array("-b", array('action' => 'count', 'nargs' => 2))); } public function testCallbackNotCallable() { $this->assertOptionError( "option -b: callback not callable: 'foo'", array("-b", array('action' => 'callback', 'callback' => 'foo'))); } public function dummy() { } public function testCallbackArgsNoArray() { $this->assertOptionError( "option -b: callbackArgs, if supplied, " . "must be an array: not 'foo'", array("-b", array('action' => 'callback', 'callback' => array($this, 'dummy'), 'callbackArgs' => 'foo'))); } public function testNoCallbackForAction() { $this->assertOptionError( "option -b: callback supplied ('foo') for non-callback option", array("-b", array('action' => 'store', 'callback' => 'foo'))); } public function testNoCallbackArgsForAction() { $this->assertOptionError( "option -b: callbackArgs supplied for non-callback option", array("-b", array('action' => 'store', 'callbackArgs' => 'foo'))); } } Horde_Argv-2.1.0/test/Horde/Argv/OptionGroupTest.php0000664000175000017500000000400313102315276020410 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_OptionGroupTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $this->parser = new Horde_Argv_Parser(array('usage' => Horde_Argv_Option::SUPPRESS_USAGE)); } public function testOptionGroupCreateInstance() { $group = new Horde_Argv_OptionGroup($this->parser, "Spam"); $this->parser->addOptionGroup($group); $group->addOption("--spam", array('action' => "store_true", 'help' => "spam spam spam spam")); $this->assertParseOK(array("--spam"), array('spam' => true), array()); } public function testAddGroupNoGroup() { $this->assertTypeError(array($this->parser, 'addOptionGroup'), "not an OptionGroup instance: NULL", array(null)); } public function testAddGroupInvalidArguments() { $this->assertTypeError(array($this->parser, 'addOptionGroup'), "invalid arguments", null); } public function testAddGroupWrongParser() { $group = new Horde_Argv_OptionGroup($this->parser, "Spam"); $group->parser = new Horde_Argv_Parser(); $this->assertRaises(array($this->parser, 'addOptionGroup'), array($group), 'InvalidArgumentException', "invalid OptionGroup (wrong parser)"); } public function testGroupManipulate() { $group = $this->parser->addOptionGroup("Group 2", array('description' => "Some more options")); $group->setTitle("Bacon"); $group->addOption("--bacon", array('type' => "int")); $this->assertSame($group, $this->parser->getOptionGroup("--bacon")); } } Horde_Argv-2.1.0/test/Horde/Argv/OptionValuesTest.php0000664000175000017500000000166113102315276020562 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_OptionValuesTest extends Horde_Argv_TestCase { public function testBasics() { $values = new Horde_Argv_Values(); $this->assertEquals(array(), iterator_to_array($values)); $this->assertNotEquals(array('foo' => 'bar'), $values); $this->assertEquals('', (string)$values); $dict = array('foo' => 'bar', 'baz' => 42); $values = new Horde_Argv_Values($dict); $this->assertEquals($dict, iterator_to_array($values)); $this->assertNotEquals(array('foo' => 'bar'), $values); $this->assertNotEquals(array(), $values); $this->assertNotEquals('', (string)$values); } } Horde_Argv-2.1.0/test/Horde/Argv/ParseNumTest.php0000664000175000017500000000407713102315276017670 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_ParseNumTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $this->parser = new Horde_Argv_InterceptingParser(); $this->parser->addOption('-n', array('type' => 'int')); $this->parser->addOption('-l', array('type' => 'long')); } public function testParseNumFail() { $this->assertFalse(Horde_Argv_Option::parseNumber('')); $this->assertFalse(Horde_Argv_Option::parseNumber("0xOoops")); } public function testParseNumOk() { $this->assertSame(0, Horde_Argv_Option::parseNumber('0')); $this->assertSame(16, Horde_Argv_Option::parseNumber('0x10')); $this->assertSame(10, Horde_Argv_Option::parseNumber('0XA')); $this->assertSame(8, Horde_Argv_Option::parseNumber('010')); $this->assertSame(3, Horde_Argv_Option::parseNumber('0b11')); $this->assertSame(0, Horde_Argv_Option::parseNumber('0b')); } public function testNumericOptions() { $this->assertParseOk(array("-n", "42", "-l", "0x20"), array("n" => 42, "l" => 0x20), array()); $this->assertParseOk(array("-n", "0b0101", "-l010"), array("n" => 5, "l" => 8), array()); $this->assertParseFail(array("-n008"), "option -n: invalid integer value: '008'"); $this->assertParseFail(array("-l0b0123"), "option -l: invalid long integer value: '0b0123'"); $this->assertParseFail(array("-l", "0x12x"), "option -l: invalid long integer value: '0x12x'"); } } Horde_Argv-2.1.0/test/Horde/Argv/ParserTest.php0000664000175000017500000000740513102315276017370 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_ParserTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $this->parser = new Horde_Argv_Parser(); $this->parser->addOption('-v', '--verbose', '-n', '--noisy', array('action' => 'store_true', 'dest' => 'verbose')); $this->parser->addOption('-q', '--quiet', '--silent', array('action' => 'store_false', 'dest' => 'verbose')); } public function testAddOptionNoOption() { $this->assertTypeError(array($this->parser, 'addOption'), "not an Option instance: NULL", array(null)); } public function testAddOptionInvalidArguments() { $this->assertTypeError(array($this->parser, 'addOption'), "invalid arguments", null); } public function testGetOption() { $opt1 = $this->parser->getOption("-v"); $this->assertInstanceOf('Horde_Argv_Option', $opt1); $this->assertEquals($opt1->shortOpts, array("-v", "-n")); $this->assertEquals($opt1->longOpts, array("--verbose", "--noisy")); $this->assertEquals($opt1->action, "store_true"); $this->assertEquals($opt1->dest, "verbose"); } public function testGetOptionEquals() { $opt1 = $this->parser->getOption("-v"); $opt2 = $this->parser->getOption("--verbose"); $opt3 = $this->parser->getOption("-n"); $opt4 = $this->parser->getOption("--noisy"); $this->assertEquals($opt1, $opt2); $this->assertEquals($opt1, $opt3); $this->assertEquals($opt1, $opt4); } public function testHasOption() { $this->assertTrue($this->parser->hasOption("-v")); $this->assertTrue($this->parser->hasOption("--verbose")); } public function assertRemoved() { $this->assertNull($this->parser->getOption("-v")); $this->assertNull($this->parser->getOption("--verbose")); $this->assertNull($this->parser->getOption("-n")); $this->assertNull($this->parser->getOption("--noisy")); $this->assertFalse($this->parser->hasOption("-v")); $this->assertFalse($this->parser->hasOption("--verbose")); $this->assertFalse($this->parser->hasOption("-n")); $this->assertFalse($this->parser->hasOption("--noisy")); $this->assertTrue($this->parser->hasOption("-q")); $this->assertTrue($this->parser->hasOption("--silent")); } public function testRemoveShortOpt() { $this->parser->removeOption('-n'); $this->assertRemoved(); } public function testRemoveLongOpt() { $this->parser->removeOption('--verbose'); $this->assertRemoved(); } public function testRemoveNonexistent() { $this->assertRaises(array($this->parser, 'removeOption'), array('foo'), 'InvalidArgumentException', "no such option 'foo'"); } /** def test_refleak(self): # If a Horde_Argv_Parser is carrying around a reference to a large # object, various cycles can prevent it from being GC'd in # a timely fashion. destroy() breaks the cycles to ensure stuff # can be cleaned up. big_thing = [42] refcount = sys.getrefcount(big_thing) parser = Horde_Argv_Parser() parser.addOption("-a", "--aaarggh") parser.big_thing = big_thing parser.destroy() del parser $this->assertEquals(refcount, sys.getrefcount(big_thing)) */ } Horde_Argv-2.1.0/test/Horde/Argv/phpunit.xml0000664000175000017500000000005613102315276016767 0ustar janjan Horde_Argv-2.1.0/test/Horde/Argv/ProgNameTest.php0000664000175000017500000000520713102315276017642 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_ProgNameTest extends Horde_Argv_TestCase { public function setUp() { if (!isset($_SERVER['argv'])) { $_SERVER['argv'] = array('test'); } } public function tearDown() { unset($_SERVER['argv']); } public function assertUsage($parser, $expectedUsage) { $this->assertEquals($parser->getUsage(), $expectedUsage); } public function assertVersion($parser, $expectedVersion) { $this->assertEquals($parser->getVersion(), $expectedVersion); } public function testDefaultProgName() { // Make sure that program name is taken from $_SERVER['argv'][0] by // default. $saveArgv = $_SERVER['argv']; try { $_SERVER['argv'][0] = 'foo/bar/baz.php'; $parser = new Horde_Argv_Parser(array( 'usage' => "%prog ...", 'version' => "%prog 1.2", 'formatter' => new Horde_Argv_IndentedHelpFormatter( 2, 24, null, true, new Horde_Cli_Color(Horde_Cli_Color::FORMAT_NONE) ) )); $expectedUsage = "Usage: baz.php ...\n"; } catch (Exception $e) { $_SERVER['argv'] = $saveArgv; throw($e); } $this->assertUsage($parser, $expectedUsage); $this->assertVersion($parser, "baz.php 1.2"); $this->assertHelp($parser, $expectedUsage . "\n" . "Options:\n" . " --version show program's version number and exit\n" . " -h, --help show this help message and exit\n"); } public function testCustomProgName() { $parser = new Horde_Argv_Parser(array( 'prog' => 'thingy', 'version' => "%prog 0.1", 'usage' => "%prog arg arg", 'formatter' => new Horde_Argv_IndentedHelpFormatter( 2, 24, null, true, new Horde_Cli_Color(Horde_Cli_Color::FORMAT_NONE) ) )); $parser->removeOption('-h'); $parser->removeOption('--version'); $expectedUsage = "Usage: thingy arg arg\n"; $this->assertUsage($parser, $expectedUsage); $this->assertVersion($parser, "thingy 0.1"); $this->assertHelp($parser, $expectedUsage . "\n"); } } Horde_Argv-2.1.0/test/Horde/Argv/StandardTest.php0000664000175000017500000001554313102315276017676 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_StandardTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $options = array( $this->makeOption('-a', array('type' => 'string')), $this->makeOption('-b', '--boo', array('type' => 'int', 'dest' => 'boo')), $this->makeOption('--foo', array('action' => 'append')) ); $this->parser = new Horde_Argv_InterceptingParser(array('usage' => Horde_Argv_Option::SUPPRESS_USAGE, 'optionList' => $options)); } public function testRequiredValue() { $this->assertParseFail(array('-a'), '-a option requires an argument'); } public function testInvalidInteger() { $this->assertParseFail(array('-b', '5x'), "option -b: invalid integer value: '5x'"); } public function testNoSuchOption() { $this->assertParseFail(array('--boo13'), "no such option: --boo13"); } public function testLongInvalidInteger() { $this->assertParseFail(array("--boo=x5"), "option --boo: invalid integer value: 'x5'"); } public function testEmpty() { $this->assertParseOk(array(), array('a' => null, 'boo' => null, 'foo' => null), array()); } public function testShortOptEmptyLongOptAppend() { $this->assertParseOk(array("-a", "", "--foo=blah", "--foo="), array('a' => "", 'boo' => null, 'foo' => array("blah", "")), array()); } public function testLongOptionAppend() { $this->assertParseOk(array("--foo", "bar", "--foo", "", "--foo=x"), array('a' => null, 'boo' => null, 'foo' => array('bar', '', 'x')), array()); } public function testOptionArgumentJoined() { $this->assertParseOk(array("-abc"), array('a' => "bc", 'boo' => null, 'foo' => null), array()); } public function testOptionArgumentSplit() { $this->assertParseOk(array("-a", "34"), array('a' => "34", 'boo' => null, 'foo' => null), array()); } public function testOptionArgumentJoinedInteger() { $this->assertParseOk(array("-b34"), array('a' => null, 'boo' => 34, 'foo' => null), array()); } public function testOptionArgumentSplitNegativeInteger() { $this->assertParseOk(array("-b", "-5"), array('a' => null, 'boo' => -5, 'foo' => null), array()); } public function testLongOptionArgumentJoined() { $this->assertParseOk(array("--boo=13"), array('a' => null, 'boo' => 13, 'foo' => null), array()); } public function testLongOptionArgumentSplit() { $this->assertParseOk(array("--boo", "111"), array('a' => null, 'boo' => 111, 'foo' => null), array()); } public function testLongOptionShortOption() { $this->assertParseOk(array("--foo=bar", "-axyz"), array('a' => 'xyz', 'boo' => null, 'foo' => array("bar")), array()); } public function testAbbrevLongOption() { $this->assertParseOk(array("--f=bar", "-axyz"), array('a' => 'xyz', 'boo' => null, 'foo' => array("bar")), array()); } public function testDefaults() { list($options, $args) = $this->parser->parseArgs(array()); $defaults = $this->parser->getDefaultValues(); $this->assertEquals($defaults, $options); } public function testAmbiguousOption() { $this->parser->addOption("--foz", array('action' => 'store', 'type' => 'string', 'dest' => 'foo')); $this->assertParseFail(array('--f=bar'), "ambiguous option: --f (--foo, --foz?)"); } public function testShortAndLongOptionSplit() { $this->assertParseOk(array("-a", "xyz", "--foo", "bar"), array('a' => 'xyz', 'boo' => null, 'foo' => array("bar")), array()); } public function testShortOptionSplitLongOptionAppend() { $this->assertParseOk(array("--foo=bar", "-b", "123", "--foo", "baz"), array('a' => null, 'boo' => 123, 'foo' => array("bar", "baz")), array()); } public function testShortOptionSplitOnePositionalArg() { $this->assertParseOk(array("-a", "foo", "bar"), array('a' => "foo", 'boo' => null, 'foo' => null), array("bar")); } public function testShortOptionConsumesSeparator() { $this->assertParseOk(array("-a", "--", "foo", "bar"), array('a' => "--", 'boo' => null, 'foo' => null), array("foo", "bar")); $this->assertParseOk(array("-a", "--", "--foo", "bar"), array('a' => "--", 'boo' => null, 'foo' => array("bar")), array()); } public function testShortOptionJoinedAndSeparator() { $this->assertParseOk(array("-ab", "--", "--foo", "bar"), array('a' => "b", 'boo' => null, 'foo' => null), array("--foo", "bar")); } public function testHyphenBecomesPositionalArg() { $this->assertParseOk(array("-ab", "-", "--foo", "bar"), array('a' => "b", 'boo' => null, 'foo' => array("bar")), array("-")); } public function testNoAppendVersusAppend() { $this->assertParseOk(array("-b3", "-b", "5", "--foo=bar", "--foo", "baz"), array('a' => null, 'boo' => 5, 'foo' => array("bar", "baz")), array()); } public function testOptionConsumesOptionLikeString() { $this->assertParseOk(array("-a", "-b3"), array('a' => "-b3", 'boo' => null, 'foo' => null), array()); } } Horde_Argv-2.1.0/test/Horde/Argv/TestCase.php0000664000175000017500000001130513102315276017001 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_TestCase extends PHPUnit_Framework_TestCase { public static function setUpBeforeClass() { setlocale(LC_ALL, 'C'); } public static function tearDownAfterClass() { setlocale(LC_ALL, ''); } public function makeOption() { $args = func_get_args(); $reflector = new ReflectionClass('Horde_Argv_Option'); return $reflector->newInstanceArgs($args); } /** * Assert the options are what we expected when parsing arguments. * * Otherwise, fail with a nicely formatted message. * * Keyword arguments: * args -- A list of arguments to parse with Horde_Argv_Parser. * expected_opts -- The options expected. * expected_positional_args -- The positional arguments expected. * * Returns the options and positional args for further testing. */ public function assertParseOK($args, $expected_opts, $expected_positional_args) { list($options, $positional_args) = $this->parser->parseArgs($args); $optdict = iterator_to_array($options); $this->assertEquals($expected_opts, $optdict, 'Expected options don\'t match. Args were ' . print_r($args, true)); $this->assertEquals($positional_args, $expected_positional_args, 'Positional arguments don\'t match. Args were ' . print_r($args, true)); return array($options, $positional_args); } /** * Assert that the expected exception is raised when calling a * function, and that the right error message is included with * that exception. * * Arguments: * func -- the function to call * args -- positional arguments to `func` * expected_exception -- exception that should be raised * expected_message -- expected exception message (or pattern * if a compiled regex object) * * Returns the exception raised for further testing. */ public function assertRaises($func, $args, $expected_exception, $expected_message) { $caught = false; try { if (is_array($args)) { call_user_func_array($func, $args); } else { call_user_func($func); } } catch (Exception $e) { if (get_class($e) == $expected_exception) { $caught = true; $this->assertEquals($expected_message, $e->getMessage(), 'Expected exception message not matched'); } } if (!$caught) { $this->fail("Expected exception $expected_exception not thrown"); } } // -- Assertions used in more than one class -------------------- /** * Assert the parser fails with the expected message. Caller * must ensure that $this->parser is an InterceptingParser. */ public function assertParseFail($cmdline_args, $expected_output) { try { $this->parser->parseArgs($cmdline_args); } catch (Horde_Argv_InterceptedException $e) { $this->assertEquals($expected_output, (string)$e); return true; } catch (Exception $e) { $this->fail("unexpected Exception: " . $e->getMessage()); } $this->fail("expected parse failure"); } /** * Assert the parser prints the expected output on stdout. */ public function assertOutput( $cmdline_args, $expected_output, $expected_status = 0, $expected_error = null) { ob_start(); try { $this->parser->parseArgs($cmdline_args); } catch (Horde_Argv_InterceptedException $e) { $output = ob_get_clean(); $this->assertEquals($expected_output, $output, 'Expected parser output to match'); $this->assertEquals($expected_status, $e->exit_status); $this->assertEquals($expected_error, $e->exit_message); return; } ob_end_clean(); $this->fail("expected parser->parserExit()"); } /** * Assert that TypeError is raised when executing func. */ public function assertTypeError($func, $expected_message, $args) { $this->assertRaises($func, $args, 'InvalidArgumentException', $expected_message); } public function assertHelp($parser, $expected_help) { $actual_help = $parser->formatHelp(); $this->assertEquals($expected_help, $actual_help); } } Horde_Argv-2.1.0/test/Horde/Argv/TypeAliasesTest.php0000664000175000017500000000173413102315276020356 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_TypeAliasesTest extends Horde_Argv_TestCase { public function setUp() { parent::setUp(); $this->parser = new Horde_Argv_Parser(); } public function testStrAliasesString() { $this->parser->addOption("-s", array('type' => "str")); $this->assertEquals($this->parser->getOption("-s")->type, "string"); } public function testNewTypeObject() { $this->parser->addOption("-s", array('type' => 'str')); $this->assertEquals($this->parser->getOption("-s")->type, "string"); $this->parser->addOption("-x", array('type' => 'int')); $this->assertEquals($this->parser->getOption("-x")->type, "int"); } } Horde_Argv-2.1.0/test/Horde/Argv/VersionTest.php0000664000175000017500000000245713102315276017563 0ustar janjan * @author Mike Naberezny * @license http://www.horde.org/licenses/bsd BSD * @category Horde * @package Argv * @subpackage UnitTests */ class Horde_Argv_VersionTest extends Horde_Argv_TestCase { public function setUp() { if (!isset($_SERVER['argv'])) { $_SERVER['argv'] = array('test'); } } public function tearDown() { unset($_SERVER['argv']); } public function testVersion() { $this->parser = new Horde_Argv_InterceptingParser(array( 'usage' => Horde_Argv_Option::SUPPRESS_USAGE, 'version' => "%prog 0.1")); $saveArgv = $_SERVER['argv']; try { $_SERVER['argv'][0] = __DIR__ . '/foo/bar'; $this->assertOutput(array("--version"), "bar 0.1\n"); } catch (Exception $e) { $_SERVER['argv'] = $saveArgv; throw $e; } $_SERVER['argv'] = $saveArgv; } public function testNoVersion() { $this->parser = new Horde_Argv_InterceptingParser(array('usage' => Horde_Argv_Option::SUPPRESS_USAGE)); $this->assertParseFail(array("--version"), "no such option: --version"); } }