@@ -43,17 +43,56 @@ public function __construct(PackageDiff $packageDiff, array $gitlabDomains = arr
4343 protected function configure ()
4444 {
4545 $ this ->setName ('diff ' )
46- ->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 ' )
49- ->addOption ('base ' , 'b ' , InputOption::VALUE_REQUIRED , 'Base composer.lock file path or git ref ' , 'HEAD:composer.lock ' )
50- ->addOption ('target ' , 't ' , InputOption::VALUE_REQUIRED , 'Target composer.lock file path or git ref ' , 'composer.lock ' )
46+ ->setDescription ('Compares composer.lock files and shows package changes ' )
47+ ->addArgument ('base ' , InputArgument::OPTIONAL , 'Base (original) composer.lock file path or git ref ' )
48+ ->addArgument ('target ' , InputArgument::OPTIONAL , 'Target (modified) composer.lock file path or git ref ' )
49+ ->addOption ('base ' , 'b ' , InputOption::VALUE_REQUIRED , 'Base (original) composer.lock file path or git ref ' , 'HEAD:composer.lock ' )
50+ ->addOption ('target ' , 't ' , InputOption::VALUE_REQUIRED , 'Target (modified) composer.lock file path or git ref ' , 'composer.lock ' )
5151 ->addOption ('no-dev ' , null , InputOption::VALUE_NONE , 'Ignore dev dependencies ' )
5252 ->addOption ('no-prod ' , null , InputOption::VALUE_NONE , 'Ignore prod dependencies ' )
5353 ->addOption ('with-platform ' , 'p ' , InputOption::VALUE_NONE , 'Include platform dependencies (PHP version, extensions, etc.) ' )
5454 ->addOption ('with-links ' , 'l ' , InputOption::VALUE_NONE , 'Include compare/release URLs ' )
5555 ->addOption ('format ' , 'f ' , InputOption::VALUE_REQUIRED , 'Output format (mdtable, mdlist, json) ' , 'mdtable ' )
56- ->addOption ('gitlab-domains ' , null , InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY , 'Gitlab domains ' , array ())
56+ ->addOption ('gitlab-domains ' , null , InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY , 'Extra Gitlab domains (inherited from Composer config by default) ' , array ())
57+ ->setHelp (<<<'EOF'
58+ The <comment>%command.name%</comment> command displays all dependency changes between two <info>composer.lock</info> files.
59+ By default, it will compare current filesystem changes with git <info>HEAD</info>:
60+
61+ <comment>%command.full_name%</comment>
62+
63+ To compare with specific branch, pass its name as argument:
64+
65+ <comment>%command.full_name% master</comment>
66+
67+ You can specify any valid git refs to compare with:
68+
69+ <comment>%command.full_name% HEAD~3 be4aabc</comment>
70+
71+ You can also use more verbose syntax for <info>base</info> and <info>target</info> options:
72+
73+ <comment>%command.full_name% --base master --target composer.lock</comment>
74+
75+ To compare files in specific path, use following syntax:
76+
77+ <comment>%command.full_name% master:subdirectory/composer.lock /path/to/another/composer.lock</comment>
78+
79+ By default, <info>platform</info> dependencies are hidden. Add <comment>--with-platform</comment> option to include them in the report:
80+
81+ <comment>%command.full_name% --with-platform</comment>
82+
83+ Use <comment>--with-links</comment> to include release and compare URLs in the report:
84+
85+ <comment>%command.full_name% --with-links</comment>
86+
87+ You can customize output format by specifying it with <comment>--format</comment> option. Choose between <info>mdtable</info>, <info>mdlist</info> and <info>json</info>:
88+
89+ <comment>%command.full_name% --format=json</comment>
90+
91+ Hide <info>dev</info> dependencies using <comment>--no-dev</comment> option:
92+
93+ <comment>%command.full_name% --no-dev</comment>
94+ EOF
95+ )
5796 ;
5897 }
5998
0 commit comments