git-php icon indicating copy to clipboard operation
git-php copied to clipboard

Make $commandProcessor 'protected'

Open solicomo opened this issue 1 year ago • 4 comments

so that it can be used by sub class of Runners.

solicomo avatar May 20 '23 19:05 solicomo

Hello, what is your use-case? Why do you need this change?

janpecha avatar May 22 '23 04:05 janpecha

Hello, what is your use-case? Why do you need this change?

I need to extend CliRunner to support more options. And that requires an extended CommandProcessor. In the extended CliRunner, I need to use the extended CommmandProcessor.

In the meanwhile, I don't want to copy all of the code in CliRunner::run() to the extended CliRunner.

In on word, both CliRunner and the extended CliRunner need to access $commandProcessor.

solicomo avatar May 22 '23 15:05 solicomo

I need to extend CliRunner to support more options. And that requires an extended CommandProcessor.

Can you give me some examples? Maybe exists better solution.

janpecha avatar Jun 01 '23 10:06 janpecha

I need to extend CliRunner to support more options. And that requires an extended CommandProcessor.

Can you give me some examples? Maybe exists better solution.

For example, I need -c option to specify ssh key file which is not the default one. -c has to go to after git but before sub command.

The current implementation is CommandProcesser always put options after sub command.

Actually, I think -c is worth a set of specific API. So I created another PR#91.

This PR is still needed for other similar cases.

solicomo avatar Jun 01 '23 13:06 solicomo