bamarni / symfony-console-autocomplete

Shell autocompletion for Symfony Console based scripts
Other
496 stars 32 forks source link

Potential optimization. #30

Closed rquadling closed 6 years ago

rquadling commented 7 years ago

Currently, the autocomplete generator runs my app over 60 times (once for the list of commands, and then once per command).

Capturing what is actually run ...

Array
(
    [0] => ./wu  list --raw | awk '{if (NF>1) print $1 " " substr($0, index($0,$2)); else print $1}'
    [1] => ./wu  help --format=xml bulk-redeem
    [2] => ./wu  help --format=xml capture-mobi
    [3] => ./wu  help --format=xml dump-session
    [4] => ./wu  help --format=xml generate-offer-codes
    [5] => ./wu  help --format=xml help
    [6] => ./wu  help --format=xml list
    [7] => ./wu  help --format=xml protect-migrations
    [8] => ./wu  help --format=xml reset-migrations
    [9] => ./wu  help --format=xml update-hosts
    [10] => ./wu  help --format=xml code:verify-subscriber-signatures
...

But all that data is available via 1 command:

./wu --xml list

Here's an edited snippet of the output (matching the list of calls above) ...

<?xml version="1.0" encoding="UTF-8"?>
<symfony name="Workflow Utilities" version="Enchilada">
  <commands>
    <command id="bulk-redeem" name="bulk-redeem">
      <usages>
        <usage>bulk-redeem [--salesStart [SALESSTART]] [--salesEnd [SALESEND]] [--effectiveRedemptionDate [EFFECTIVEREDEMPTIONDATE]] [--unredeem] [--dry-run] [--] &lt;companyID&gt;</usage>
      </usages>
      <description>Bulk redeem items, based on certain criteria &lt;fire&gt;[ Development Only ]&lt;/fire&gt;</description>
      <help>This will fully redeem orders based on criteria supplied on the command line.

 A daily log will be produced in &lt;fg=yellow&gt;/Users/richardquadling/dt/app/logs/Development/BulkRedeem/&lt;/fg=yellow&gt;.
 </help>
      <arguments>
        <argument name="companyID" is_required="1" is_array="0">
          <description>Required companyID</description>
          <defaults/>
        </argument>
      </arguments>
      <options>
        <option name="--salesStart" shortcut="" accept_value="1" is_value_required="0" is_multiple="0">
          <description>Only include items sold since this date-time (eg. "2016-10-09 09:00:00")</description>
          <defaults/>
        </option>
        <option name="--salesEnd" shortcut="" accept_value="1" is_value_required="0" is_multiple="0">
          <description>Only include items sold up until this date-time (eg. "2016-10-10 23:59:59")</description>
          <defaults/>
        </option>
        <option name="--effectiveRedemptionDate" shortcut="" accept_value="1" is_value_required="0" is_multiple="0">
          <description>The redemption date-time to use (eg. "2016-01-01 00:00:00"). Defaults to "now".</description>
          <defaults/>
        </option>
        <option name="--unredeem" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Un-redeem the matching items</description>
        </option>
        <option name="--dry-run" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Dry run - do not make any changes</description>
        </option>
        <option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Display this help message</description>
        </option>
        <option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Do not output any message</description>
        </option>
        <option name="--verbose" shortcut="-v" shortcuts="-v|-vv|-vvv" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug</description>
        </option>
        <option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Display this application version</description>
        </option>
        <option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Force ANSI output</description>
        </option>
        <option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Disable ANSI output</description>
        </option>
        <option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Do not ask any interactive question</description>
        </option>
      </options>
    </command>
    <command id="capture-mobi" name="capture-mobi">
      <usages>
        <usage>capture-mobi [-i|--ip-address IP-ADDRESS] [-u|--username USERNAME] [-p|--password PASSWORD] [--enable] [--disable]</usage>
      </usages>
      <description>Tell the router to redirect the .MOBI domain to this machine &lt;fire&gt;[ Development Only ]&lt;/fire&gt;</description>
      <help>The .MOBI domain is directed to the public IP address of the router.
 This program will tell the router to redirect requests, both HTTP and HTTPS, to this machine
 Optionally, it can be told to redirect to another machine.</help>
      <arguments/>
      <options>
        <option name="--ip-address" shortcut="-i" accept_value="1" is_value_required="1" is_multiple="0">
          <description>Use this IP address</description>
          <defaults>
            <default>xxxxxxxx</default>
          </defaults>
        </option>
        <option name="--username" shortcut="-u" accept_value="1" is_value_required="1" is_multiple="0">
          <description>Router username</description>
          <defaults>
            <default>xxxxxxxxxx</default>
          </defaults>
        </option>
        <option name="--password" shortcut="-p" accept_value="1" is_value_required="1" is_multiple="0">
          <description>Router password</description>
          <defaults>
            <default>xxxxxxxxxx</default>
          </defaults>
        </option>
        <option name="--enable" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Enable NAT redirection for the .MOBI domain to this machine.</description>
        </option>
        <option name="--disable" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Disable NAT redirection for the .MOBI domain to this machine.</description>
        </option>
        <option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Display this help message</description>
        </option>
        <option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Do not output any message</description>
        </option>
        <option name="--verbose" shortcut="-v" shortcuts="-v|-vv|-vvv" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug</description>
        </option>
        <option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Display this application version</description>
        </option>
        <option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Force ANSI output</description>
        </option>
        <option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Disable ANSI output</description>
        </option>
        <option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Do not ask any interactive question</description>
        </option>
      </options>
    </command>
    <command id="dump-session" name="dump-session">
      <usages>
        <usage>dump-session [-w|--watch] [--] &lt;session&gt;</usage>
      </usages>
      <description>Dump session &lt;fire&gt;[ Personal Only ]&lt;/fire&gt;</description>
      <help>Dump session &lt;fire&gt;[ Personal Only ]&lt;/fire&gt;</help>
      <arguments>
        <argument name="session" is_required="1" is_array="0">
          <description>Session filename in &lt;file&gt;~/dt/data/sessions&lt;/file&gt;.</description>
          <defaults/>
        </argument>
      </arguments>
      <options>
        <option name="--watch" shortcut="-w" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Watch for changes to the file</description>
        </option>
        <option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Display this help message</description>
        </option>
        <option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Do not output any message</description>
        </option>
        <option name="--verbose" shortcut="-v" shortcuts="-v|-vv|-vvv" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug</description>
        </option>
        <option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Display this application version</description>
        </option>
        <option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Force ANSI output</description>
        </option>
        <option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Disable ANSI output</description>
        </option>
        <option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Do not ask any interactive question</description>
        </option>
      </options>
    </command>
    <command id="generate-offer-codes" name="generate-offer-codes">
      <usages>
        <usage>generate-offer-codes [-s|--save] [-e|--environment ENVIRONMENT] [--] &lt;offerID&gt; &lt;qty&gt;</usage>
      </usages>
      <description>Generate a number of unique codes for an offer &lt;fire&gt;[ Development Only ]&lt;/fire&gt;</description>
      <help>Generate a number of unique codes for an offer &lt;fire&gt;[ Development Only ]&lt;/fire&gt;</help>
      <arguments>
        <argument name="offerID" is_required="1" is_array="0">
          <description>The ID of the offer for which you want to generate coupon codes</description>
          <defaults/>
        </argument>
        <argument name="qty" is_required="1" is_array="0">
          <description>The number of coupon codes you wish to generate</description>
          <defaults/>
        </argument>
      </arguments>
      <options>
        <option name="--save" shortcut="-s" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Whether to actually persist the generated code to the database</description>
        </option>
        <option name="--environment" shortcut="-e" accept_value="1" is_value_required="1" is_multiple="0">
          <description>The system you wish to generate offer codes in (development, staging, etc)</description>
          <defaults>
            <default>development</default>
          </defaults>
        </option>
        <option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Display this help message</description>
        </option>
        <option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Do not output any message</description>
        </option>
        <option name="--verbose" shortcut="-v" shortcuts="-v|-vv|-vvv" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug</description>
        </option>
        <option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Display this application version</description>
        </option>
        <option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Force ANSI output</description>
        </option>
        <option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Disable ANSI output</description>
        </option>
        <option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Do not ask any interactive question</description>
        </option>
      </options>
    </command>
    <command id="help" name="help">
      <usages>
        <usage>help [--xml] [--format FORMAT] [--raw] [--] [&lt;command_name&gt;]</usage>
      </usages>
      <description>Displays help for a command</description>
      <help>The &lt;info&gt;help&lt;/info&gt; command displays help for a given command:

   &lt;info&gt;php ./wu help list&lt;/info&gt;

 You can also output the help in other formats by using the &lt;comment&gt;--format&lt;/comment&gt; option:

   &lt;info&gt;php ./wu help --format=xml list&lt;/info&gt;

 To display the list of available commands, please use the &lt;info&gt;list&lt;/info&gt; command.</help>
      <arguments>
        <argument name="command_name" is_required="0" is_array="0">
          <description>The command name</description>
          <defaults>
            <default>help</default>
          </defaults>
        </argument>
      </arguments>
      <options>
        <option name="--xml" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>To output help as XML</description>
        </option>
        <option name="--format" shortcut="" accept_value="1" is_value_required="1" is_multiple="0">
          <description>The output format (txt, xml, json, or md)</description>
          <defaults>
            <default>txt</default>
          </defaults>
        </option>
        <option name="--raw" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>To output raw command help</description>
        </option>
        <option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Display this help message</description>
        </option>
        <option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Do not output any message</description>
        </option>
        <option name="--verbose" shortcut="-v" shortcuts="-v|-vv|-vvv" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug</description>
        </option>
        <option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Display this application version</description>
        </option>
        <option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Force ANSI output</description>
        </option>
        <option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Disable ANSI output</description>
        </option>
        <option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Do not ask any interactive question</description>
        </option>
      </options>
    </command>
    <command id="list" name="list">
      <usages>
        <usage>list [--xml] [--raw] [--format FORMAT] [--] [&lt;namespace&gt;]</usage>
      </usages>
      <description>Lists commands</description>
      <help>The &lt;info&gt;list&lt;/info&gt; command lists all commands:

   &lt;info&gt;php ./wu list&lt;/info&gt;

 You can also display the commands for a specific namespace:

   &lt;info&gt;php ./wu list test&lt;/info&gt;

 You can also output the information in other formats by using the &lt;comment&gt;--format&lt;/comment&gt; option:

   &lt;info&gt;php ./wu list --format=xml&lt;/info&gt;

 It's also possible to get raw list of commands (useful for embedding command runner):

   &lt;info&gt;php ./wu list --raw&lt;/info&gt;</help>
      <arguments>
        <argument name="namespace" is_required="0" is_array="0">
          <description>The namespace name</description>
          <defaults/>
        </argument>
      </arguments>
      <options>
        <option name="--xml" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>To output list as XML</description>
        </option>
        <option name="--raw" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>To output raw command list</description>
        </option>
        <option name="--format" shortcut="" accept_value="1" is_value_required="1" is_multiple="0">
          <description>The output format (txt, xml, json, or md)</description>
          <defaults>
            <default>txt</default>
          </defaults>
        </option>
      </options>
    </command>
    <command id="protect-migrations" name="protect-migrations">
      <usages>
        <usage>protect-migrations [-r|--rename] [--force] [-d|--down-only]</usage>
      </usages>
      <description>Rename local migrations that have not been deployed so that they are at the head of the queue. &lt;fire&gt;[ Development Only ]&lt;/fire&gt;</description>
      <help>The purpose of this script is to examine any migrations that have not been run on the production
 environment and to move them so that no rollback is performed on the production environment.
 For example, if a 2 independent feature branches are developed, each with their own migrations, are
 feature finished and released at different times, the second branch's migrations will appear as "down"
 within the live migrations.

 When these are migrated, phinx will rollback the new migrations necessary to run all of the migrations
 in order.

 This will almost certainly result in data loss.

 So this script is an attempt to prevent that from happening.

 The steps taken are as follows:
 1 - Identify all the migrations in the codebase.
 2 - Identify all the migrations in the production environment.
 3 - Analyse the dates to make sure that all of the outstanding migrations will not cause any rollback in
     the production environment.
 4 - Optionally, renumber all the outstanding migrations, preserving their order, so that they all occur
     after the most recent production migration.

 Ideally, this needs to be done just before branch is merged and deployed and run for one branch at a time</help>
      <arguments/>
      <options>
        <option name="--rename" shortcut="-r" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Rename the migration SQL scripts.</description>
        </option>
        <option name="--force" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Force a rename even if migrations are correctly positioned.</description>
        </option>
        <option name="--down-only" shortcut="-d" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Only rename migrations that are down locally.</description>
        </option>
        <option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Display this help message</description>
        </option>
        <option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Do not output any message</description>
        </option>
        <option name="--verbose" shortcut="-v" shortcuts="-v|-vv|-vvv" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug</description>
        </option>
        <option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Display this application version</description>
        </option>
        <option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Force ANSI output</description>
        </option>
        <option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Disable ANSI output</description>
        </option>
        <option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Do not ask any interactive question</description>
        </option>
      </options>
    </command>
    <command id="reset-migrations" name="reset-migrations">
      <usages>
        <usage>reset-migrations [--reset-migrations] [-m|--mysqldump-path MYSQLDUMP-PATH] [-e|--environment ENVIRONMENT]</usage>
      </usages>
      <description>Remove all migrations and rebuild the initial data structure and seed data SQL files. &lt;fire&gt;[ Development Only ]&lt;/fire&gt;</description>
      <help>The purpose of this script is to remove all migrations and rebuild the initial data structure and the seed data SQL files.</help>
      <arguments/>
      <options>
        <option name="--reset-migrations" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Reset phinx and remove the migrations. Without this option, only the initial schema and seed data SQL files will be built.</description>
        </option>
        <option name="--mysqldump-path" shortcut="-m" accept_value="1" is_value_required="1" is_multiple="0">
          <description>Alternative path to mysqldump utility</description>
          <defaults/>
        </option>
        <option name="--environment" shortcut="-e" accept_value="1" is_value_required="1" is_multiple="0">
          <description>The target environment</description>
          <defaults>
            <default>development</default>
          </defaults>
        </option>
        <option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Display this help message</description>
        </option>
        <option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Do not output any message</description>
        </option>
        <option name="--verbose" shortcut="-v" shortcuts="-v|-vv|-vvv" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug</description>
        </option>
        <option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Display this application version</description>
        </option>
        <option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Force ANSI output</description>
        </option>
        <option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Disable ANSI output</description>
        </option>
        <option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Do not ask any interactive question</description>
        </option>
      </options>
    </command>
    <command id="update-hosts" name="update-hosts">
      <usages>
        <usage>update-hosts [-s|--specific-ip SPECIFIC-IP] [--] [&lt;hosts&gt;]</usage>
      </usages>
      <description>Add all DigiTickets sub-domains to your local hosts file &lt;fire&gt;[ Development Only ]&lt;/fire&gt;</description>
      <help>This program will add all the sub-domains from the digitickets.companies database to your local hosts file.</help>
      <arguments>
        <argument name="hosts" is_required="0" is_array="0">
          <description>The full filename of your hosts file</description>
          <defaults>
            <default>/etc/hosts</default>
          </defaults>
        </argument>
      </arguments>
      <options>
        <option name="--specific-ip" shortcut="-s" accept_value="1" is_value_required="1" is_multiple="0">
          <description>The specific IP address to use for the sub-domains</description>
          <defaults>
            <default>127.0.0.1</default>
          </defaults>
        </option>
        <option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Display this help message</description>
        </option>
        <option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Do not output any message</description>
        </option>
        <option name="--verbose" shortcut="-v" shortcuts="-v|-vv|-vvv" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug</description>
        </option>
        <option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Display this application version</description>
        </option>
        <option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Force ANSI output</description>
        </option>
        <option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Disable ANSI output</description>
        </option>
        <option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Do not ask any interactive question</description>
        </option>
      </options>
    </command>
    <command id="code:verify-subscriber-signatures" name="code:verify-subscriber-signatures">
      <usages>
        <usage>code:verify-subscriber-signatures</usage>
      </usages>
      <description>Verify that the signatures of the PHPMaker CMS Subscribers are correctly following our pattern &lt;fire&gt;[ Development and Staging Only ]&lt;/fire&gt;</description>
      <help>Verify that the signatures of the PHPMaker CMS Subscribers are correctly following our pattern.
 This will alert you to any naming collisions that previously existed</help>
      <arguments/>
      <options>
        <option name="--help" shortcut="-h" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Display this help message</description>
        </option>
        <option name="--quiet" shortcut="-q" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Do not output any message</description>
        </option>
        <option name="--verbose" shortcut="-v" shortcuts="-v|-vv|-vvv" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug</description>
        </option>
        <option name="--version" shortcut="-V" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Display this application version</description>
        </option>
        <option name="--ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Force ANSI output</description>
        </option>
        <option name="--no-ansi" shortcut="" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Disable ANSI output</description>
        </option>
        <option name="--no-interaction" shortcut="-n" accept_value="0" is_value_required="0" is_multiple="0">
          <description>Do not ask any interactive question</description>
        </option>
      </options>
    </command>
  </commands>
  <namespaces>
    <namespace id="_global">
      <command>bulk-redeem</command>
      <command>capture-mobi</command>
      <command>dump-session</command>
      <command>generate-offer-codes</command>
      <command>help</command>
      <command>list</command>
      <command>protect-migrations</command>
      <command>reset-migrations</command>
      <command>update-hosts</command>
    </namespace>
    <namespace id="code">
      <command>code:verify-subscriber-signatures</command>
    </namespace>
  </namespaces>
</symfony>

The only minor difference is that the descriptions are still with their styling. (e.g. <fire>[ DEVELOPMENT ONLY ]</fire>)

But (at least for bash), the descriptions aren't used anywhere in $(brew --prefix)/etc/bash_completion.d/wu, so maybe that's a non-issue.

If this is also true for the other shells, then calling the application once rather than n+1 times results in a nicer experience and means keeping the autocomplete uptodate isn't as long as it currently is.

andytson-inviqa commented 6 years ago

I made a PR to do this https://github.com/bamarni/symfony-console-autocomplete/pull/34. It'll keep the descriptions the same format, zsh format supports them

rquadling commented 6 years ago

The PR was accepted and merged. Now waiting on a release. Hopefully @bamarni will pick this up soon.