33
44use Symfony \Component \Console \Command \Command ;
55use Symfony \Component \Console \Input \InputArgument ;
6+ use Symfony \Component \Console \Input \InputDefinition ;
67use Symfony \Component \Console \Input \InputInterface ;
78use Symfony \Component \Console \Input \InputOption ;
89use Symfony \Component \Console \Output \OutputInterface ;
@@ -14,12 +15,21 @@ class RunCommand extends Command
1415 protected function configure ()
1516 {
1617 $ this
17- ->setDescription ('Run JVM ' )
18+ ->addArgument (
19+ 'file ' ,
20+ InputArgument::REQUIRED ,
21+ 'Specify to run [jar|class] file. '
22+ )
23+ ->addArgument (
24+ 'parameters ' ,
25+ InputArgument::OPTIONAL | InputArgument::IS_ARRAY ,
26+ 'Specify parameters to pass for entrypoint. '
27+ )
1828 ->addOption (
19- 'options ' ,
20- 'o ' ,
29+ 'settings ' ,
30+ 's ' ,
2131 InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY ,
22- 'Set options '
32+ 'Set option settings. '
2333 )
2434 ->addOption (
2535 'mode ' ,
@@ -32,16 +42,18 @@ protected function configure()
3242 'e ' ,
3343 InputOption::VALUE_OPTIONAL ,
3444 'Overwrite entrypoint '
35- )
36- ->addArgument (
37- 'parameters ' ,
38- InputArgument::OPTIONAL | InputArgument::IS_ARRAY ,
39- 'Define parameters to pass for entrypoint. '
4045 );
4146 }
4247
4348 protected function execute (InputInterface $ input , OutputInterface $ output )
4449 {
45- $ options = $ input ->getOptions ();
50+ $ settings = $ input ->getOption ('settings ' ) ?? [];
51+ $ mode = $ input ->getOption ('mode ' ) ?? 'class ' ;
52+ $ entrypoint = $ input ->getOption ('entrypoint ' ) ?? null ;
53+ $ file = $ input ->getArgument ('file ' );
54+ $ parameters = $ input ->getArgument ('parameters ' );
55+
56+
57+ var_dump ($ file );
4658 }
4759}
0 commit comments