Looking at the vget code, the help text is inaccurate. It now uses a regex that will match any part of the variable name.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

pwolanin’s picture

Status: Active » Needs review
FileSize
928 bytes
koglinjg’s picture

I noticed this discrepancy today and would like to be able to look for strictly what I am asking for. Can we add a "--strict" option to only take exact matches. Right now I have to do a secondary grep to remove extraneous results of other items that contain my search term in addition to some other prefix or suffix.

I will submit a patch in the next few days when I add it for myself, but if anyone else wants to beat me to it ... ;p

pwolanin’s picture

vdel takes an --exact option so maybe copy that for vget too?

damiankloip’s picture

FileSize
1.2 KB

I think the --exact option is a good idea. Here is a patch that implements that. It might be worth thinking about having additional args taken if exact is used too?

koglinjg’s picture

Thanks, damiankloip that patch looks great. Applied cleanly against 7.x-5.4 and works like a charm.

damiankloip’s picture

@koglinjg, good to hear! :)

Although maybe I should roll pwolanins changes to the help text in there too.

damiankloip’s picture

FileSize
1.65 KB
moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

Seems ok to me. Any objections?

greg.1.anderson’s picture

Didn't test, but seems okay. Maybe vset should accept --exact (as a synonym for --always-set) for consistency? Maybe remove --always-set in Drush-6?

damiankloip’s picture

Here is a path that both adds the synonym and removes the always set method. You guys can choose then :)

moshe weitzman’s picture

Assigned: Unassigned » greg.1.anderson

I'll let greg review and commit this. I have no preference.

greg.1.anderson’s picture

Status: Reviewed & tested by the community » Fixed

Committed the first option for backwards-compatibility with existing Drush-5.x behavior, but hid --always-set in the help text to encourage folks to migrate to --exact. Also added a test for --exact.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.