Skip to content

Impossible to read filename or '-' #91

@OnkelTem

Description

@OnkelTem

It's very common for a file processing script to either take the filename OR '-' to get data from stdin.
With this library I cannot do this:

php convert.php input.log
php convert.php - < input.log

Whenever I pass "-" it says

ERROR: Unable to parse option -: Invalid syntax

My definition was like:

  $cmd->option()
    ->require()
    ->describedAs('Input log file or `-` to read from stdin');

and value reading part was as simple as:

  $filename = $cmd[0];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions