Skip to content

Feature request: Make help text wrap width configurable #687

Description

@kyouheiab

Feature Request

Currently, the wrap method in lib/bashly/extensions/string.rb uses a hardcoded 80-character width:

def wrap(length = 80)

This causes all help text (descriptions, examples, etc.) to be wrapped at 80 characters, which can break readability.

Example:

examples:
- mycli create item MyItem --type=SomeType --sender=SenderName --receiver=ReceiverName

Current output (wrapped at 80):

Examples:
 mycli create item MyItem --type=SomeType --sender=SenderName
 --receiver=ReceiverName

Request:
Add a wrap_width setting in settings.yml to allow users to configure the wrap width for all help text, or disable wrapping entirely.

Activity

  1. DannyBen commented on Dec 5, 2025

    @DannyBen
    Member

    While I don't object to making the line-wrapping width configurable, I still stand firmly behind the original decision to default to 80 characters.

    As someone who frequently works in split panes and on headless machines, I find long, wrapped lines frustrating. They break visual structure and make terminal output much harder to scan.

    On top of that, longer line lengths are generally harder to read. Many style guides, accessibility recommendations, and typographic studies discourage lines much beyond 70–80 characters for exactly that reason.

    Bashly encourages (and sometimes enforces) best practices.


    If you have command lines that exceed 80 characters, they are probably too long to type comfortably as well. In those cases, I would consider refactoring the interface.
    But even if you ultimately do need a longer command, you can still show it cleanly in the examples:

    Examples:
      download example.com --long option \
        --and-more "long options" and \
        --even more options and \
        --finally some more

    This can be represented in bashly.yml using either array syntax:

    examples:
    - |
      download example.com --long option \\ \
        --and-more "long options" and \\ \
        --even more options and \\ \
        --finally some more

    or string syntax:

    examples: |
      # Download something
      download example.com --long option \\ \
        --and-more "long options" and \\ \
        --even more options and \\ \
        --finally some more
    
      # Another example
      download ...

    That said, I will consider exposing the default width as a configurable option.

  2. added this to the 1.3.5 milestone on Dec 5, 2025
  3. DannyBen commented on Dec 5, 2025

    @DannyBen
    Member

    Implemented in #688 if you want to test.

  4. DannyBen commented on Dec 12, 2025

    @DannyBen
    Member

    Released in v1.3.5.
    Thanks for the suggestion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions