Skip to content

Commit

Permalink
Merge pull request #10699 from cabalism/doc/path-command-config-group
Browse files Browse the repository at this point in the history
Move cabal path to project configuration group
  • Loading branch information
mergify[bot] authored Jan 4, 2025
2 parents 1082c0b + d9d57e7 commit ed1e4d7
Showing 1 changed file with 62 additions and 62 deletions.
124 changes: 62 additions & 62 deletions doc/cabal-commands.rst
Original file line number Diff line number Diff line change
Expand Up @@ -285,68 +285,6 @@ cabal preferences. It is very useful when you are e.g. first configuring
Note how ``--augment`` syntax follows ``cabal user-config diff``
output.

cabal path
^^^^^^^^^^

``cabal path`` allows to query for paths used by ``cabal``.
For example, it allows to query for the directories of the cache, store,
installed binaries, and so on.

::

$ whoami
alice

$ cabal path
compiler-flavour: ghc
compiler-id: ghc-9.8.2
compiler-path: /home/alice/.ghcup/bin/ghc
cache-home: /home/alice/.cabal
remote-repo-cache: /home/alice/.cabal/packages
logs-dir: /home/alice/.cabal/logs
store-dir: /home/alice/.cabal/store
config-file: /home/alice/.cabal/config
installdir: /home/alice/.cabal/bin

Or using the json output:

::

$ cabal path --output-format=json | jq

.. code-block:: json
{
"cabal-version": "3.13.0.0",
"compiler": {
"flavour": "ghc",
"id": "ghc-9.8.2",
"path": "/home/alice/.ghcup/bin/ghc"
},
"cache-home": "/home/alice/.cabal",
"remote-repo-cache": "/home/alice/.cabal/packages",
"logs-dir": "/home/alice/.cabal/logs",
"store-dir": "/home/alice/.cabal/store",
"config-file": "/home/alice/.cabal/config",
"installdir": "/home/alice/.cabal/bin"
}
If ``cabal path`` is passed a single option naming a path, then that
path will be printed *without* any label:

::

$ cabal path --installdir
/home/alice/.cabal/bin

While this interface is intended to be used for scripting, it is an experimental command.
Scripting example:

::

$ ls $(cabal path --installdir)
...

.. _command-group-database:

Package database commands
Expand Down Expand Up @@ -734,6 +672,68 @@ Examples:
be used without arguments, in that case major version bumps are ignored for
all packages.

cabal path
^^^^^^^^^^

``cabal path`` allows to query for paths used by ``cabal``.
For example, it allows to query for the directories of the cache, store,
installed binaries, and so on.

::

$ whoami
alice

$ cabal path
compiler-flavour: ghc
compiler-id: ghc-9.8.2
compiler-path: /home/alice/.ghcup/bin/ghc
cache-home: /home/alice/.cabal
remote-repo-cache: /home/alice/.cabal/packages
logs-dir: /home/alice/.cabal/logs
store-dir: /home/alice/.cabal/store
config-file: /home/alice/.cabal/config
installdir: /home/alice/.cabal/bin

Or using the json output:

::

$ cabal path --output-format=json | jq

.. code-block:: json
{
"cabal-version": "3.13.0.0",
"compiler": {
"flavour": "ghc",
"id": "ghc-9.8.2",
"path": "/home/alice/.ghcup/bin/ghc"
},
"cache-home": "/home/alice/.cabal",
"remote-repo-cache": "/home/alice/.cabal/packages",
"logs-dir": "/home/alice/.cabal/logs",
"store-dir": "/home/alice/.cabal/store",
"config-file": "/home/alice/.cabal/config",
"installdir": "/home/alice/.cabal/bin"
}
If ``cabal path`` is passed a single option naming a path, then that
path will be printed *without* any label:

::

$ cabal path --installdir
/home/alice/.cabal/bin

While this interface is intended to be used for scripting, it is an experimental command.
Scripting example:

::

$ ls $(cabal path --installdir)
...

.. _command-group-build:

Project building and installing
Expand Down

0 comments on commit ed1e4d7

Please sign in to comment.