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.22.0 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.21.5 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.21.4 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.21.3 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.21.2 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.21.1 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.21.0 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.20.1 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.20.0 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.19.2 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.19.1 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.19.0 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.18.2 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.18.1 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.18.0 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.17.2 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.17.1 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.17.0 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.16.1 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb
gli-2.16.0 lib/gli/commands/help_modules/terminal_synopsis_formatter.rb