FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=18008&edit=1

ID: 18008
Comment by: RQuadling@GMail.com
Reported By: cweiske at php dot net
Summary: support "list" arguments like list options
Status: Open
Type: Feature/Change Request
Package: Console_CommandLine
Package Version: 1.1.3
PHP Version: Irrelevant
Roadmap Versions:
New Comment:

The obvious answer is to use --target $targetsystem and --target is a
list controlled option.


Previous Comments:
------------------------------------------------------------------------

[2010-10-29 09:58:41] cweiske

Description:
------------
It would be cool if Console_CommandLine would support the "list"
parameter for arguments - the way it does for options.

Example:
My tool is used to copy files to one of a list of supported remote
systems.
$ php copy.php $targetsystem file1 file2 ...

Now $targetsystem is no option but a mandatory argument, and only a list
of allowed options is possible.

------------------------------------------------------------------------

Search Discussions

  • Cweiske at Oct 29, 2010 at 10:12 am
    Edit report at http://pear.php.net/bugs/bug.php?id=18008&edit=1

    ID: 18008
    Updated by: cweiske@php.net
    Reported By: cweiske at php dot net
    Summary: support "list" arguments like list options
    Status: Open
    Type: Feature/Change Request
    Package: Console_CommandLine
    Package Version: 1.1.3
    PHP Version: Irrelevant
    Roadmap Versions:
    New Comment:

    Using an option is not an option since options are optional :)


    Previous Comments:
    ------------------------------------------------------------------------

    [2010-10-29 11:08:47] rquadling

    The obvious answer is to use --target $targetsystem and --target is a
    list controlled option.

    ------------------------------------------------------------------------

    [2010-10-29 09:58:41] cweiske

    Description:
    ------------
    It would be cool if Console_CommandLine would support the "list"
    parameter for arguments - the way it does for options.

    Example:
    My tool is used to copy files to one of a list of supported remote
    systems.
    $ php copy.php $targetsystem file1 file2 ...

    Now $targetsystem is no option but a mandatory argument, and only a list
    of allowed options is possible.

    ------------------------------------------------------------------------
  • Izi at Oct 29, 2010 at 10:21 am
    Edit report at http://pear.php.net/bugs/bug.php?id=18008&edit=1

    ID: 18008
    Updated by: izi@php.net
    Reported By: cweiske at php dot net
    Summary: support "list" arguments like list options
    Status: Open
    Type: Feature/Change Request
    Package: Console_CommandLine
    Package Version: 1.1.3
    PHP Version: Irrelevant
    Roadmap Versions:
    New Comment:

    I agree with Christian here, and this is clearly explained in the
    Console_CommandLine manual:

    "Lots of people want their programs to have "required options". Think
    about it. If
    it's required, then it's not optional! If there is a piece of
    information that your
    program absolutely requires in order to run successfully, that's what
    arguments are
    for."

    I'll be super busy for the next monthes... Christian or Richard, feel
    free to work on
    this !

    --
    David


    Previous Comments:
    ------------------------------------------------------------------------

    [2010-10-29 11:12:36] cweiske

    Using an option is not an option since options are optional :)

    ------------------------------------------------------------------------

    [2010-10-29 11:08:47] rquadling

    The obvious answer is to use --target $targetsystem and --target is a
    list controlled option.

    ------------------------------------------------------------------------

    [2010-10-29 09:58:41] cweiske

    Description:
    ------------
    It would be cool if Console_CommandLine would support the "list"
    parameter for arguments - the way it does for options.

    Example:
    My tool is used to copy files to one of a list of supported remote
    systems.
    $ php copy.php $targetsystem file1 file2 ...

    Now $targetsystem is no option but a mandatory argument, and only a list
    of allowed options is possible.

    ------------------------------------------------------------------------


    --
    Edit this bug report at http://pear.php.net/bugs/bug.php?id=18008&edit=1
  • RQuadling at Oct 29, 2010 at 10:49 am
    Edit report at http://pear.php.net/bugs/bug.php?id=18008&edit=1

    ID: 18008
    Comment by: RQuadling@GMail.com
    Reported By: cweiske at php dot net
    Summary: support "list" arguments like list options
    Status: Open
    Type: Feature/Change Request
    Package: Console_CommandLine
    Package Version: 1.1.3
    PHP Version: Irrelevant
    Roadmap Versions:
    New Comment:

    My opinion on this is that all the command line options and arguments
    should have all the same features. I draw your attention to
    http://pear.php.net/bugs/bug.php?id=16679, though I couldn't argue my
    case well enough it seems.


    I think I should be able to have an 'action' for an argument (filename
    or directory validation for example: exists, !exists). Christian would
    like a 'list' for an argument.


    Previous Comments:
    ------------------------------------------------------------------------

    [2010-10-29 11:22:25] izi

    I agree with Christian here, and this is clearly explained in the
    Console_CommandLine manual:

    "Lots of people want their programs to have "required options". Think
    about it. If
    it's required, then it's not optional! If there is a piece of
    information that your
    program absolutely requires in order to run successfully, that's what
    arguments are
    for."

    I'll be super busy for the next monthes... Christian or Richard, feel
    free to work on
    this !

    --
    David

    ------------------------------------------------------------------------

    [2010-10-29 11:12:36] cweiske

    Using an option is not an option since options are optional :)

    ------------------------------------------------------------------------

    [2010-10-29 11:08:47] rquadling

    The obvious answer is to use --target $targetsystem and --target is a
    list controlled option.

    ------------------------------------------------------------------------

    [2010-10-29 09:58:41] cweiske

    Description:
    ------------
    It would be cool if Console_CommandLine would support the "list"
    parameter for arguments - the way it does for options.

    Example:
    My tool is used to copy files to one of a list of supported remote
    systems.
    $ php copy.php $targetsystem file1 file2 ...

    Now $targetsystem is no option but a mandatory argument, and only a list
    of allowed options is possible.

    ------------------------------------------------------------------------


    --
    Edit this bug report at http://pear.php.net/bugs/bug.php?id=18008&edit=1

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedOct 29, '10 at 10:08a
activeOct 29, '10 at 10:49a
posts4
users3
websitepear.php.net

3 users in discussion

RQuadling: 2 posts Cweiske: 1 post Izi: 1 post

People

Translate

site design / logo © 2022 Grokbase