Skip to content

Commit adc2e9c

Browse files
committed
WIP: Update
1 parent 1820af6 commit adc2e9c

File tree

3 files changed

+27
-12
lines changed

3 files changed

+27
-12
lines changed

bin/Commands/JVM/RunCommand.php

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
use Symfony\Component\Console\Command\Command;
55
use Symfony\Component\Console\Input\InputArgument;
6+
use Symfony\Component\Console\Input\InputDefinition;
67
use Symfony\Component\Console\Input\InputInterface;
78
use Symfony\Component\Console\Input\InputOption;
89
use 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
}

bin/PHPJava.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,8 @@
1111
$application = new Application();
1212
$runCommand = new RunCommand();
1313
$application->add($runCommand);
14-
$application->setDefaultCommand($runCommand->getName());
14+
$application->setDefaultCommand(
15+
$runCommand->getName(),
16+
true
17+
);
1518
$application->run();

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"php-java/java-net-package": "*",
2020
"php-java/java-nio-package": "*",
2121
"gabrielelana/byte-units": "dev-master",
22-
"symfony/console": "^4.3@dev"
22+
"symfony/console": "4.2"
2323
},
2424
"autoload": {
2525
"psr-4": {

0 commit comments

Comments
 (0)