Skip to content

Commit bccbb94

Browse files
authored
Merge pull request #8193 from jsynacek/jsynacek-doc-improve-command-option-formatting
Improve documentation formatting of some cabal command flags
2 parents f139530 + 55247d1 commit bccbb94

File tree

2 files changed

+62
-39
lines changed

2 files changed

+62
-39
lines changed

doc/cabal-commands.rst

Lines changed: 61 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -372,8 +372,10 @@ See ``cabal run`` for more information on scripts.
372372

373373
In addition ``cabal build`` accepts these flags:
374374

375-
- ``--only-configure``: When given we will forego performing a full build and
376-
abort after running the configure phase of each target package.
375+
.. option:: --only-configure
376+
377+
When given we will forego performing a full build and abort after running
378+
the configure phase of each target package.
377379

378380

379381
cabal repl
@@ -703,16 +705,23 @@ and two archives of the same format built from the same source will hash to the
703705

704706
``cabal sdist`` takes the following flags:
705707

706-
- ``-l``, ``--list-only``: Rather than creating an archive, lists files that would be included.
707-
Output is to ``stdout`` by default. The file paths are relative to the project's root
708-
directory.
708+
.. option:: -l, --list-only
709+
710+
Rather than creating an archive, lists files that would be included.
711+
712+
Output is to ``stdout`` by default. The file paths are relative to the project's root
713+
directory.
714+
715+
.. option:: -o, --output-directory
709716

710-
- ``-o``, ``--output-directory``: Sets the output dir, if a non-default one is desired. The default is
711-
``dist-newstyle/sdist/``. ``--output-directory -`` will send output to ``stdout``
712-
unless multiple archives are being created.
717+
Sets the output dir, if a non-default one is desired. The default is
718+
``dist-newstyle/sdist/``. ``--output-directory -`` will send output to ``stdout``
719+
unless multiple archives are being created.
713720

714-
- ``--null-sep``: Only used with ``--list-only``. Separates filenames with a NUL
715-
byte instead of newlines.
721+
.. option:: --null-sep
722+
723+
Only used with ``--list-only``. Separates filenames with a NUL
724+
byte instead of newlines.
716725

717726
``sdist`` is inherently incompatible with sdist hooks (which were removed in `Cabal-3.0`),
718727
not due to implementation but due to fundamental core invariants
@@ -738,43 +747,57 @@ description file or freeze file.
738747

739748
``cabal outdated`` supports the following flags:
740749

741-
- ``--v1-freeze-file``: Read dependency version bounds from the freeze file
742-
(``cabal.config``) instead of the package description file
743-
(``$PACKAGENAME.cabal``).
750+
.. option:: --v1-freeze-file
751+
752+
Read dependency version bounds from the freeze file.
753+
754+
(``cabal.config``) instead of the package description file
755+
(``$PACKAGENAME.cabal``).
756+
757+
.. option:: --v2-freeze-file
758+
759+
:since: 2.4
760+
761+
Read dependency version bounds from the v2-style freeze file
762+
(by default, ``cabal.project.freeze``) instead of the package
763+
description file. ``--new-freeze-file`` is an alias for this flag
764+
that can be used with pre-2.4 ``cabal``.
765+
766+
.. option:: --project-file PROJECTFILE
767+
768+
:since: 2.4
769+
770+
Read dependendency version bounds from the v2-style freeze file
771+
related to the named project file (i.e., ``$PROJECTFILE.freeze``)
772+
instead of the package desctription file. If multiple ``--project-file``
773+
flags are provided, only the final one is considered. This flag
774+
must only be passed in when ``--new-freeze-file`` is present.
744775

745-
- ``--v2-freeze-file``:
776+
.. option:: --simple-output
746777

747-
:since: 2.4
778+
Print only the names of outdated dependencies, one per line.
748779

749-
Read dependency version bounds from the v2-style freeze file
750-
(by default, ``cabal.project.freeze``) instead of the package
751-
description file. ``--new-freeze-file`` is an alias for this flag
752-
that can be used with pre-2.4 ``cabal``.
780+
.. option:: --exit-code
753781

754-
- ``--project-file PROJECTFILE``:
782+
Exit with a non-zero exit code when there are outdated dependencies.
755783

756-
:since: 2.4
784+
.. option:: -q, --quiet
757785

758-
Read dependendency version bounds from the v2-style freeze file
759-
related to the named project file (i.e., ``$PROJECTFILE.freeze``)
760-
instead of the package desctription file. If multiple ``--project-file``
761-
flags are provided, only the final one is considered. This flag
762-
must only be passed in when ``--new-freeze-file`` is present.
786+
Don't print any output. Implies ``-v0`` and ``--exit-code``.
763787

764-
- ``--simple-output``: Print only the names of outdated dependencies, one per line.
788+
.. option:: --ignore PACKAGENAMES
765789

766-
- ``--exit-code``: Exit with a non-zero exit code when there are outdated dependencies.
790+
Don't warn about outdated dependency version bounds for the packages in this list.
767791

768-
- ``-q, --quiet``: Don't print any output. Implies ``-v0`` and ``--exit-code``.
792+
.. option:: --minor [PACKAGENAMES]
769793

770-
- ``--ignore PACKAGENAMES``: Don't warn about outdated dependency version bounds for the packages in this list.
794+
Ignore major version bumps for these packages.
771795

772-
- ``--minor [PACKAGENAMES]``: Ignore major version bumps for these packages.
773-
E.g. if there's a version 2.0 of a package ``pkg`` on Hackage and the freeze
774-
file specifies the constraint ``pkg == 1.9``, ``cabal outdated --freeze
775-
--minor=pkg`` will only consider the ``pkg`` outdated when there's a version
776-
of ``pkg`` on Hackage satisfying ``pkg > 1.9 && < 2.0``. ``--minor`` can also
777-
be used without arguments, in that case major version bumps are ignored for
778-
all packages.
796+
E.g. if there's a version 2.0 of a package ``pkg`` on Hackage and the freeze
797+
file specifies the constraint ``pkg == 1.9``, ``cabal outdated --freeze
798+
--minor=pkg`` will only consider the ``pkg`` outdated when there's a version
799+
of ``pkg`` on Hackage satisfying ``pkg > 1.9 && < 2.0``. ``--minor`` can also
800+
be used without arguments, in that case major version bumps are ignored for
801+
all packages.
779802

780-
See `the section on listing outdated dependency version bounds <cabal-package.html#listing-outdated-dependency-version-bounds>`__ for more details and examples.
803+
See `the section on listing outdated dependency version bounds <cabal-package.html#listing-outdated-dependency-version-bounds>`__ for more details and examples.

doc/cabal-project.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ package, and thus apply globally:
295295

296296
This option cannot be specified via a ``cabal.project`` file.
297297

298-
-- option:: --ignore-project
298+
.. option:: --ignore-project
299299

300300
Ignores the local ``cabal.project`` file and uses the default
301301
configuration with the local ``foo.cabal`` file. Note that

0 commit comments

Comments
 (0)