Sha256: e5576bd7c5aa30505d7f8eb6a6e5d0e7ad719c7d52d9b5c82d83370835c102e2

Contents?: true

Size: 644 Bytes

Versions: 3

Compression:

Stored size: 644 Bytes

Contents

# frozen_string_literal: true

module Lino
  module Options
    def with_option(option, value, separator: nil, quoting: nil)
      return self if missing?(value)

      with(options: @options.add(
        {
          components: [option, value],
          separator: separator,
          quoting: quoting
        }
      ))
    end

    def with_repeated_option(option, values, separator: nil, quoting: nil)
      values.inject(self) do |s, value|
        s.with_option(option, value, separator: separator, quoting: quoting)
      end
    end

    def with_flag(flag)
      with(options: @options.add({ components: [flag] }))
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lino-2.2.0.pre.1 lib/lino/options.rb
lino-2.1.0 lib/lino/options.rb
lino-2.0.0.pre.1 lib/lino/options.rb