Sha256: fa21c51a160650a3659e52645f213d9f10bac983a2d9c677b6c5794f6f75818a

Contents?: true

Size: 689 Bytes

Versions: 34

Compression:

Stored size: 689 Bytes

Contents

module GLI
  module Commands
    module HelpModules
      class TerminalSynopsisFormatter
        def initialize(app,flags_and_switches)
          @app = app
          @basic_invocation = @app.exe_name.to_s
          @flags_and_switches = flags_and_switches
        end
        def synopses_for_command(command)
          synopses = FullSynopsisFormatter.new(@app,@flags_and_switches).synopses_for_command(command)
          if synopses.any? { |synopsis| synopsis.length > Terminal.instance.size[0] }
            CompactSynopsisFormatter.new(@app,@flags_and_switches).synopses_for_command(command)

          else
            synopses
          end
        end
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
gli-2.15.0 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.14.0 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.13.4 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.13.3 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.13.2 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.13.1 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.13.0 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.12.3 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.12.2 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.12.1 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.12.0 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.11.0 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.10.0 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.9.0 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb