Skip to content

Conversation

@Ahmed-AdelB
Copy link

Summary

This PR adds documentation for short option combining behavior, as requested in #2779.

Changes

  1. New "Combining Short Options" section in docs/options.md:

    • Explains that short options can be combined (e.g., -abc = -a -b -c)
    • Shows examples of combining flags
    • Demonstrates how values can be attached to combined options
    • Adds a note clarifying that multi-character short options are NOT supported
  2. Changelog entry added to CHANGES.rst

Per maintainer request

Following @Rowlando13's guidance in the issue:

Add docs section in options section with:

  • Title: combining short options
  • the short option combining behavior explanation and example
  • note about multi character short options not being supported

Closes #2779


Ahmed Adel Bakr Alderai

Rowlando13 and others added 3 commits November 24, 2025 23:35
Add documentation explaining the standard POSIX behavior of combining
short options (e.g., -abc is equivalent to -a -b -c). This section
includes:

- Explanation of short option combining with examples
- Example showing value attachment to combined options
- Note clarifying that multi-character short options are not supported

Closes pallets#2779

---
Ahmed Adel Bakr Alderai
@Rowlando13 Rowlando13 changed the base branch from main to stable January 1, 2026 08:40

Short options that consist of a single character can be combined into a
single argument. For example, `-a -b -c` can be written as `-abc`. This
is standard POSIX behavior and applies to any short options, including
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to single short option


```{note}
Multi-character short options are not supported. An argument like `-abc`
is always interpreted as the combination of `-a`, `-b`, and `-c`, not as
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove always

is always interpreted as the combination of `-a`, `-b`, and `-c`, not as
a single option named `-abc`. If you need longer option names, use long
options with `--` prefix instead (e.g., `--abc`).
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should read: with the -- prefix

@Rowlando13
Copy link
Collaborator

Great pr, with a few minor things to fix! Also please rebase onto stable.

@Rowlando13 Rowlando13 added the docs label Jan 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong error message when wrong multicharacter short option is passed

2 participants