Sha256: 0f5708a25cd721eedb40f77ce58e168e520141aad6d2236ae1b4c5c9671262a6

Contents?: true

Size: 536 Bytes

Versions: 23

Compression:

Stored size: 536 Bytes

Contents

module GLI
  module Commands
    module HelpModules
      # Handles wrapping text
      class ArgNameFormatter
        def format(arguments_description,arguments_options)
          return '' if String(arguments_description).strip == ''
          desc = arguments_description
          if arguments_options.include? :optional
            desc = "[#{desc}]"
          end
          if arguments_options.include? :multiple
            desc = "#{desc}[, #{desc}]*"
          end
          " " + desc
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
gli-2.10.0 lib/gli/commands/help_modules/arg_name_formatter.rb
gli-2.9.0 lib/gli/commands/help_modules/arg_name_formatter.rb
gli_aziz_light-2.8.1 lib/gli/commands/help_modules/arg_name_formatter.rb
gli-2.8.1 lib/gli/commands/help_modules/arg_name_formatter.rb
gli-2.8.0 lib/gli/commands/help_modules/arg_name_formatter.rb
gli-2.7.0 lib/gli/commands/help_modules/arg_name_formatter.rb
gli-2.6.2 lib/gli/commands/help_modules/arg_name_formatter.rb
gli-2.6.1 lib/gli/commands/help_modules/arg_name_formatter.rb
gli-2.6.0 lib/gli/commands/help_modules/arg_name_formatter.rb
gli-2.6.0.rc1 lib/gli/commands/help_modules/arg_name_formatter.rb
gli-2.5.6 lib/gli/commands/help_modules/arg_name_formatter.rb
gli-2.5.5 lib/gli/commands/help_modules/arg_name_formatter.rb
gli-2.5.4 lib/gli/commands/help_modules/arg_name_formatter.rb
gli-2.5.3 lib/gli/commands/help_modules/arg_name_formatter.rb
gli-2.5.2 lib/gli/commands/help_modules/arg_name_formatter.rb
gli-2.5.1 lib/gli/commands/help_modules/arg_name_formatter.rb
gli-2.5.0 lib/gli/commands/help_modules/arg_name_formatter.rb
gli-2.4.1 lib/gli/commands/help_modules/arg_name_formatter.rb
gli-2.4.0 lib/gli/commands/help_modules/arg_name_formatter.rb
gli-2.3.0 lib/gli/commands/help_modules/arg_name_formatter.rb