99use IonBazan \ComposerDiff \Formatter \MarkdownTableFormatter ;
1010use IonBazan \ComposerDiff \PackageDiff ;
1111use IonBazan \ComposerDiff \Url \GeneratorContainer ;
12+ use Symfony \Component \Console \Input \InputArgument ;
1213use Symfony \Component \Console \Input \InputInterface ;
1314use Symfony \Component \Console \Input \InputOption ;
1415use Symfony \Component \Console \Output \OutputInterface ;
@@ -43,6 +44,8 @@ protected function configure()
4344 {
4445 $ this ->setName ('diff ' )
4546 ->setDescription ('Displays package diff ' )
47+ ->addArgument ('base ' , InputArgument::OPTIONAL , 'Base composer.lock file path or git ref ' )
48+ ->addArgument ('target ' , InputArgument::OPTIONAL , 'Target composer.lock file path or git ref ' )
4649 ->addOption ('base ' , 'b ' , InputOption::VALUE_REQUIRED , 'Base composer.lock file path or git ref ' , 'HEAD:composer.lock ' )
4750 ->addOption ('target ' , 't ' , InputOption::VALUE_REQUIRED , 'Target composer.lock file path or git ref ' , 'composer.lock ' )
4851 ->addOption ('no-dev ' , null , InputOption::VALUE_NONE , 'Ignore dev dependencies ' )
@@ -59,8 +62,8 @@ protected function configure()
5962 */
6063 protected function execute (InputInterface $ input , OutputInterface $ output )
6164 {
62- $ base = $ input ->getOption ('base ' );
63- $ target = $ input ->getOption ('target ' );
65+ $ base = $ input ->getArgument ( ' base ' ) !== null ? $ input -> getArgument ( ' base ' ) : $ input -> getOption ('base ' );
66+ $ target = $ input ->getArgument ( ' target ' ) !== null ? $ input -> getArgument ( ' target ' ) : $ input -> getOption ('target ' );
6467 $ withPlatform = $ input ->getOption ('with-platform ' );
6568 $ withUrls = $ input ->getOption ('with-links ' );
6669 $ this ->gitlabDomains = array_merge ($ this ->gitlabDomains , $ input ->getOption ('gitlab-domains ' ));
0 commit comments