Skip to content

Unknown option "employee" #255

@leup

Description

@leup

PrestaShop version(s)

1.7.

Php version

7.2

Fop Console version

dev

Operating system

linux

command

No response

Describe the bug

Hello everyone,

I may have misused the cli command but I did not succeed to use the employee option as defined here:

$commandDefinition->addOption(new InputOption('employee', '-em', InputOption::VALUE_REQUIRED, 'Specify employee context (id).', null));

I tried -em, --em, --employee to no avail.

What I found was that the option seems to be configured too late in the process. The "option not found" was emitted before entering the initialize method.

So I had to move it to configure() as such:

    protected function configure()
    {
        $this->addOption('employee', null, InputOption::VALUE_REQUIRED, 'Specify employee context (id).', null);

        parent::configure();
    }

(I also removed the shortcut because at first I thought it was the issue)

Did I misused the option or is this a real bug ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions