# File lib/zfs/snapshot.rb, line 27
    def self.list(dataset=nil, options={})
      snapshots = []
      flags=[]
      flags << "-d 1" if dataset and !options['recursive']
      flags << "-r" if options['recursive']
      cmd = "zfs list #{flags.join(" ")} -H -t snapshot -o name,used -S name"
      cmd += " #{dataset}" if dataset
      puts cmd if $debug
      IO.popen cmd do |io|
        io.readlines.each do |line|
          line.chomp!
          snapshot_name,used = line.split(' ')
          snapshots << self.new(snapshot_name, used.to_i)
        end
      end
      snapshots
    end