Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pmi --format=csv skips missing fields #502

Closed
jcheek opened this issue Mar 5, 2014 · 1 comment
Closed

pmi --format=csv skips missing fields #502

jcheek opened this issue Mar 5, 2014 · 1 comment
Assignees

Comments

@jcheek
Copy link

jcheek commented Mar 5, 2014

Hello,

I am parsing the output of drush pmi --format=csv with certain fields enabled: --fields=extension,version,path,status. All is fine unless one of the fields is missing in the module, e.g. version.

When displaying output in another format, it may be acceptable to simply delete the information if it doesn't exist, but in CSV, that's not ok. A blank entry must be output or else all of the fields after it on that line are thrown off.

As an example, here's drush's output for argfilters, a sandbox project at http://drupalcode.org/sandbox/itangalo/1086472.git. It's .info file has no version, and drush pmi doesn't (normally) really care:

$ drush pmi argfilters
 Extension     :  argfilters
 Project       :  Unknown
 Type          :  module
 Title         :  Views arguments in filters
 Description   :  Allows you to use argument values in filters, thereby
                  leveraging functionality such as operators.
 Date          :
 Package       :  Experimental
 Core          :  7.x
 PHP           :  5.2.4
 Status        :  enabled
 Path          :  sites/all/modules/contrib/views_arguments_in_filters
 Schema        :  module has no schema
 version
 Files         :  none
 Requires      :  views
 Required by   :  autocompleteinator, autocompleteinator_helper,
                  more_custom_modules_here
 Permissions   :  none
 Configure     :  None

version is just shown as empty, above, but with --format-csv, it doesn't work; it simply removes the entire field, instead of (correctly) adding a blank field:

$ drush pmi --format=csv --fields=extension,version,path,status argfilters
argfilters,sites/all/modules/contrib/views_arguments_in_filters,enabled

Four fields were requested, three were returned. i can't (easily) parse this.

Please fix! This is in 6.2.0.

@greg-1-anderson
Copy link
Member

Sorry this was never fixed in the pre-Drush-9 output format engine, which is now in maintenance only. Drush 9 + output formatters should do this correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants