def group(*args)
      options = args.last.is_a?(Hash) ? args.pop : {}
      groups = args

      groups.each do |group|
        next unless group.to_sym == :all
        fail ArgumentError, "'all' is not an allowed group name!"
      end

      if block_given?
        groups.each do |group|
          # TODO: let groups be added *after* evaluation
          Guard.state.session.groups.add(group, options)
        end

        @current_groups ||= []
        @current_groups.push(groups)

        yield

        @current_groups.pop
      else
        UI.error \
          "No Guard plugins found in the group '#{ groups.join(', ') }',"\
          " please add at least one."
      end
    end
def group(*args)
      options = args.last.is_a?(Hash) ? args.pop : {}
      groups = args

      groups.each do |group|
        next unless group.to_sym == :all
        fail ArgumentError, "'all' is not an allowed group name!"
      end

      if block_given?
        groups.each do |group|
          # TODO: let groups be added *after* evaluation
          Guard.state.session.groups.add(group, options)
        end

        @current_groups ||= []
        @current_groups.push(groups)

        yield

        @current_groups.pop
      else
        UI.error \
          "No Guard plugins found in the group '#{ groups.join(', ') }',"\
          " please add at least one."
      end
    end
Declares a group of Guard plugins to be run with `guard start --group
   group_name`.

 @example Declare two groups of Guard plugins
   group :backend do
     guard :spork
     guard :rspec
   end

   group :frontend do
     guard :passenger
     guard :livereload
   end

 @param [Symbol, String, Array<Symbol, String>] name the group name called
   from the CLI
 @param [Hash] options the options accepted by the group
 @yield a block where you can declare several Guard plugins

 @see Group
 @see Guard.add_group
 @see #guard