chef

https://github.com/opscode/chef

Ruby

A systems integration framework, built to bring the benefits of configuration management to your entire infrastructure.

Chef::Knife::Search#create_result_filter

This method turns a set of key value pairs in a string into the appropriate data structure that the
chef-server search api is expecting.
expected input is in the form of:
-f "return_var1=path.to.attribute, return_var2=shorter.path"

a more concrete example might be:
-f "env=chef_environment, ruby_platform=languages.ruby.platform"

The end result is a hash where the key is a symbol in the hash (the return variable)
and the path is an array with the path elements as strings (in order)
See lib/chef/search/query.rb for more examples of this.

Source | Google | Stack overflow

Edit

git clone [email protected]:opscode/chef.git

cd chef

open knife/lib/chef/knife/search.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Chef--Knife--Search-create_result_filter-for-pr


# Commit to git

git add knife/lib/chef/knife/search.rbgit commit -m "better docs for Chef::Knife::Search#create_result_filter"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Chef--Knife--Search-create_result_filter-for-pr

hub pull-request


# Celebrate!