class ChefCLI::PolicyfileServices::ShowPolicy

def display_all_policies

def display_all_policies
  if policy_lister.empty?
    ui.err("No policies or policy groups exist on the server")
    return
  end
  if policy_lister.policies_by_name.empty?
    ui.err("No policies exist on the server")
    return
  end
  policy_lister.revision_ids_by_group_for_each_policy do |policy_name, rev_id_by_group|
    report.h1(policy_name)
    if rev_id_by_group.empty?
      ui.err("Policy #{policy_name} is not assigned to any groups")
      ui.err("")
    else
      rev_ids_for_report = format_rev_ids_for_report(rev_id_by_group)
      report.table_list(rev_ids_for_report)
    end
    if show_orphans?
      orphans = policy_lister.orphaned_revisions(policy_name)
      unless orphans.empty?
        report.h2("Orphaned:")
        formatted_orphans = orphans.map { |id| shorten_rev_id(id) }
        report.list(formatted_orphans)
      end
    end
  end
end