浏览代码

Merge pull request #7464 from rellect/composer_i

Add `composer i` shorthand for `composer install`
Jordi Boggiano 7 年之前
父节点
当前提交
6f56ce062c
共有 3 个文件被更改,包括 4 次插入3 次删除
  1. 2 2
      doc/03-cli.md
  2. 1 0
      src/Composer/Command/InstallCommand.php
  3. 1 1
      src/Composer/Command/UpdateCommand.php

+ 2 - 2
doc/03-cli.md

@@ -65,7 +65,7 @@ php composer.phar init
   to a `composer` repository or a JSON string which similar to what the
   to a `composer` repository or a JSON string which similar to what the
   [repositories](04-schema.md#repositories) key accepts.
   [repositories](04-schema.md#repositories) key accepts.
 
 
-## install
+## install / i
 
 
 The `install` command reads the `composer.json` file from the current
 The `install` command reads the `composer.json` file from the current
 directory, resolves the dependencies, and installs them into `vendor`.
 directory, resolves the dependencies, and installs them into `vendor`.
@@ -115,7 +115,7 @@ resolution.
   requirements and force the installation even if the local machine does not
   requirements and force the installation even if the local machine does not
   fulfill these. See also the [`platform`](06-config.md#platform) config option.
   fulfill these. See also the [`platform`](06-config.md#platform) config option.
 
 
-## update
+## update / u
 
 
 In order to get the latest versions of the dependencies and to update the
 In order to get the latest versions of the dependencies and to update the
 `composer.lock` file, you should use the `update` command. This command is also
 `composer.lock` file, you should use the `update` command. This command is also

+ 1 - 0
src/Composer/Command/InstallCommand.php

@@ -32,6 +32,7 @@ class InstallCommand extends BaseCommand
     {
     {
         $this
         $this
             ->setName('install')
             ->setName('install')
+            ->setAliases(array('i'))
             ->setDescription('Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.')
             ->setDescription('Installs the project dependencies from the composer.lock file if present, or falls back on the composer.json.')
             ->setDefinition(array(
             ->setDefinition(array(
                 new InputOption('prefer-source', null, InputOption::VALUE_NONE, 'Forces installation from package sources when possible, including VCS information.'),
                 new InputOption('prefer-source', null, InputOption::VALUE_NONE, 'Forces installation from package sources when possible, including VCS information.'),

+ 1 - 1
src/Composer/Command/UpdateCommand.php

@@ -34,7 +34,7 @@ class UpdateCommand extends BaseCommand
     {
     {
         $this
         $this
             ->setName('update')
             ->setName('update')
-            ->setAliases(array('upgrade'))
+            ->setAliases(array('u', 'upgrade'))
             ->setDescription('Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.')
             ->setDescription('Upgrades your dependencies to the latest version according to composer.json, and updates the composer.lock file.')
             ->setDefinition(array(
             ->setDefinition(array(
                 new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Packages that should be updated, if not provided all packages are.'),
                 new InputArgument('packages', InputArgument::IS_ARRAY | InputArgument::OPTIONAL, 'Packages that should be updated, if not provided all packages are.'),