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

WIP : Manage command with multiple arguments

Open camlafit opened this issue 3 months ago • 3 comments

Propose a way to use multiple arguments to call command

Related to #132

camlafit avatar Sep 29 '25 13:09 camlafit

how deep can the subcommands go? i would prefer only 2 levels:

eg. bin cmd subcmd

where cmd is 1st, subcmd is 2nd level

how is 2nd level matched to the pool of commands? i think if 1st level cmd is matched then we can try and see if 2nd level matched to a command

adhocore avatar Oct 13 '25 11:10 adhocore

Hello

how deep can the subcommands go

Great question :) And I don't know ...

In this PR :

  • As coded, should be infinite as it's a recursive call
  • As tested, it's actually to level as two variables are used (group_name and name)

In my mind

  • should at least three levels to respect namespace, ressources and verb context.

Two variables are used to manage subcommand values. I wish to remove these variables and manage as a recursive concatenation with defined separator. By default colon as actually in base code or space as in this proposition.

camlafit avatar Oct 13 '25 14:10 camlafit

ya upto 3 seems good: "cmd subcmd action"

adhocore avatar Oct 13 '25 14:10 adhocore