Skip to content

Commit

Permalink
Merge pull request #68 from opscode/ameya-list-sort-by-name
Browse files Browse the repository at this point in the history
Sorting list outputs by sort_by_field with case insensitive sort.
  • Loading branch information
kaustubh-d committed Jun 2, 2014
2 parents 3348202 + 0970bef commit b8db1a6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/chef/knife/cloud/list_resource_command.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def list(resources)
# display column wise only if @columns_with_info is specified, else as a json for readable display.
begin
resource_list = @columns_with_info.map { |col_info| ui.color(col_info[:label], :bold) } if @columns_with_info.length > 0
resources.sort_by(&@sort_by_field.to_sym).each do |resource|
resources.sort_by{|x| x.send(@sort_by_field).downcase }.each do |resource|
if @columns_with_info.length > 0
list = get_resource_col_val(resource)
resource_list.concat(list) unless list.nil?
Expand Down

0 comments on commit b8db1a6

Please sign in to comment.