[docutils:feature-requests] #84 Recognize syntax for optional and repeating arguments in option lists

Günter Milde via Docutils-develop <[email protected]> Tue, 29 Apr 2025 10:08:19 -0000
Newsgroups gmane.text.docutils.devel
Message-ID </p/docutils/feature-requests/84/1e4e02debf2a5fa81e5e5c4ebad217b2148c1a8a.feature-requests@docutils.p.sourceforge.net>
- **status**: open --> pending
- **Priority**: 5 --> 3
- **Comment**:

Updating the option-list recognition rules to match the output of Pythons standard "argparse" module should be considered (but is not the priority problem right now).



---

**[feature-requests:#84] Recognize syntax for optional and repeating arguments in option lists**

**Status:** pending
**Group:** Default
**Labels:** reStructuredText 
**Created:** Mon Nov 01, 2021 05:44 PM UTC by Alkis Georgopoulos
**Last Updated:** Tue May 03, 2022 09:46 AM UTC
**Owner:** nobody


The [option-lists specs](https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#option-lists) state that "the syntax for short and long POSIX options is based on the syntax supported by Python's [getopt.py](https://docs.python.org/3/library/getopt.html) module".

This doesn't allow for optional or repeating arguments. A couple of examples from the [man man page](https://manpages.debian.org/bullseye/man-db/man.1.en.html#OPTIONS):

```shell
--warnings[=warnings]  This is an argument with an optional value

-m system[,...]  This is an argument with a repeating value
```

My feature request is for the square brackets `[]` to become allowed in the option lists spec and implementation in a similar way as the less than / great than symbols `<>`.

This will allow us to use docutils even when some binaries in our project do need optional or repeating arguments.
(I'm currently evaluating if it would be appropriate to migrate the https://ltsp.org and https://epoptes.org documentation and [man pages](https://ltsp.org/man/ltsp-image/), from markdown to restructuredtext)


---

Sent from sourceforge.net because [email protected] is subscribed to https://sourceforge.net/p/docutils/feature-requests/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/feature-requests/options.  Or, if this is a mailing list, you can unsubscribe from the mailing list.