# File lib/simp/cli/commands/passgen.rb, line 151
  def self.show_environment_list
    # FIXME This ASSUMES @password_dir follows a known pattern of
    #   <env dir>/<env>/simp_autofiles/gen_passwd
    # (which also assumes Linux path separators)
    unless @password_dir.include?("/simp_autofiles/gen_passwd")
      raise "Password environment directory could not be determined from '#{@password_dir}'"
    end
    env_dir = File.dirname(@password_dir.split("/simp_autofiles/")[0])
    raise "Password environment directory '#{env_dir}' does not exist" unless File.exist?(env_dir)
    raise "Password environment directory '#{env_dir}' is not a directory" unless File.directory?(env_dir)
    environments = []
    begin
      Dir.chdir(env_dir) do
        environments = Dir.glob('*').sort
      end
    rescue SystemCallError => err
      raise "Error occurred while accessing '#{env_dir}': #{err}"
    end
    puts "Environments:\n\t#{environments.join("\n\t")}"
    puts
  end