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

ID: 16679
Updated by: izi@php.net
Reported By: RQuadling at GMail dot com
Summary: Allow arguments to have Actions
-Status: Open
+Status: Wont fix
Type: Feature/Change Request
Package: Console_CommandLine
Operating System: Irrelevant
Package Version: 1.1.0
PHP Version: 5_3 CVS-2009-10-05
-Assigned To:
+Assigned To: izi
Roadmap Versions:
New Comment:

-Status: Open
+Status: Wont fix
-Assigned To:
+Assigned To: izi
I'm not sure this feature request is a good idea, validating arguments
doesn't make
much sense, closing this as "won't fix".


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

[2009-10-05 18:27:29] rquadling

Description:
------------
Quite often an argument will be a filename. Being able to specify
an action for an argument would be useful so you could verify
the supplied argument.

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

Search Discussions

  • Rquadling at Jun 7, 2010 at 9:33 am
    Edit report at http://pear.php.net/bugs/bug.php?id=16679&edit=1

    ID: 16679
    Updated by: RQuadling@GMail.com
    Reported By: RQuadling at GMail dot com
    Summary: Allow arguments to have Actions
    Status: Wont fix
    Type: Feature/Change Request
    Package: Console_CommandLine
    Operating System: Irrelevant
    Package Version: 1.1.0
    PHP Version: 5_3 CVS-2009-10-05
    Assigned To: izi
    Roadmap Versions:
    New Comment:

    The main reason is that a common sequence of events is to ask for a
    file or
    directory and then to validate that the file or directory exists.

    Allowing for this common use pattern would simplify the user's code in
    that the
    validation will already be done.

    The alternative is to create a parameter which requires a file name and
    a custom
    action.

    But then the parameter is no longer mandatory ...

    Like for PHP...

    php file.php

    or

    php -f file.php

    the -f is redundant, but would be required for Console_CommandLine to
    allow for a
    custom action to verify the existence of file.php


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

    [2010-06-06 18:17:56] izi

    -Status: Open
    +Status: Wont fix
    -Assigned To:
    +Assigned To: izi
    I'm not sure this feature request is a good idea, validating arguments
    doesn't make
    much sense, closing this as "won't fix".

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

    [2009-10-05 18:27:29] rquadling

    Description:
    ------------
    Quite often an argument will be a filename. Being able to specify
    an action for an argument would be useful so you could verify
    the supplied argument.

    ------------------------------------------------------------------------
  • Izi at Jun 8, 2010 at 8:42 am
    Edit report at http://pear.php.net/bugs/bug.php?id=16679&edit=1

    ID: 16679
    Updated by: izi@php.net
    Reported By: RQuadling at GMail dot com
    Summary: Allow arguments to have Actions
    Status: Wont fix
    Type: Feature/Change Request
    Package: Console_CommandLine
    Operating System: Irrelevant
    Package Version: 1.1.0
    PHP Version: 5_3 CVS-2009-10-05
    Assigned To: izi
    Roadmap Versions:
    New Comment:
    The main reason is that a common sequence of events is to ask for a
    file or directory and then to
    validate that the file or directory exists.
    Yep but I can't see any other common usecase, furthermore sometimes you
    want to provide a file that does not exists and will be created by the
    script, like an output file.
    The alternative is to create a parameter which requires a file name
    and a custom action. But then
    the parameter is no longer mandatory ...
    Or you could just do:
    if (!file_exists($parser->args['file'])) { ... }

    Regards,

    --
    David


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

    [2010-06-07 10:26:02] rquadling

    The main reason is that a common sequence of events is to ask for a
    file or
    directory and then to validate that the file or directory exists.

    Allowing for this common use pattern would simplify the user's code in
    that the
    validation will already be done.

    The alternative is to create a parameter which requires a file name and
    a custom
    action.

    But then the parameter is no longer mandatory ...

    Like for PHP...

    php file.php

    or

    php -f file.php

    the -f is redundant, but would be required for Console_CommandLine to
    allow for a
    custom action to verify the existence of file.php

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

    [2010-06-06 18:17:56] izi

    -Status: Open
    +Status: Wont fix
    -Assigned To:
    +Assigned To: izi
    I'm not sure this feature request is a good idea, validating arguments
    doesn't make
    much sense, closing this as "won't fix".

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

    [2009-10-05 18:27:29] rquadling

    Description:
    ------------
    Quite often an argument will be a filename. Being able to specify
    an action for an argument would be useful so you could verify
    the supplied argument.

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


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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedJun 6, '10 at 5:25p
activeJun 8, '10 at 8:42a
posts3
users2
websitepear.php.net

2 users in discussion

Izi: 2 posts Rquadling: 1 post

People

Translate

site design / logo © 2022 Grokbase