Skip to content

Commit bca688d

Browse files
committed
Update 'cabal path' documentation
1 parent 720b7d2 commit bca688d

File tree

1 file changed

+37
-13
lines changed

1 file changed

+37
-13
lines changed

doc/cabal-commands.rst

+37-13
Original file line numberDiff line numberDiff line change
@@ -288,19 +288,43 @@ cabal preferences. It is very useful when you are e.g. first configuring
288288
cabal path
289289
^^^^^^^^^^
290290

291-
``cabal path`` prints the file system paths used by ``cabal`` for
292-
cache, store, installed binaries, and so on. When run without any
293-
options, it will show all paths, labeled with how they are namen in
294-
the configuration file:
291+
``cabal path`` allows to query for paths used by ``cabal``.
292+
For example, it allows to query for the directories of the cache, store,
293+
installed binaries, and so on.
295294

296295
::
297-
$ cabal path
298-
cache-dir: /home/haskell/.cache/cabal/packages
299-
logs-dir: /home/haskell/.cache/cabal/logs
300-
store-dir: /home/haskell/.local/state/cabal/store
301-
config-file: /home/haskell/.config/cabal/config
302-
installdir: /home/haskell/.local/bin
303-
...
296+
297+
$ cabal path
298+
cache-home: /home/haskell/.cache/cabal/
299+
remote-repo-cache: /home/haskell/.cache/cabal/packages
300+
logs-dir: /home/haskell/.cache/cabal/logs
301+
store-dir: /home/haskell/.local/state/cabal/store
302+
config-file: /home/haskell/.config/cabal/config
303+
installdir: /home/haskell/.local/bin
304+
...
305+
306+
Or using the json output:
307+
308+
::
309+
310+
$ cabal path --output-format=json
311+
312+
.. code-block:: json
313+
314+
{
315+
"cabal-version": "3.11.0.0",
316+
"compiler": {
317+
"flavour": "ghc",
318+
"id": "ghc-9.6.4",
319+
"path": "/home/user/.ghcup/bin/ghc"
320+
},
321+
"cache-home": "/home/user/.cabal",
322+
"remote-repo-cache": "/home/user/.cabal/packages",
323+
"logs-dir": "/home/user/.cabal/logs",
324+
"store-dir": "/home/user/.cabal/store",
325+
"config-file": "/home/user/.cabal/config",
326+
"installdir": "/home/user/.cabal/bin"
327+
}
304328
305329
If ``cabal path`` is passed a single option naming a path, then that
306330
path will be printed *without* any label:
@@ -310,8 +334,8 @@ path will be printed *without* any label:
310334
$ cabal path --installdir
311335
/home/haskell/.local/bin
312336

313-
This is a stable interface and is intended to be used for scripting.
314-
For example:
337+
While this interface is intended to be used for scripting, it is an experimental command.
338+
Scripting example:
315339

316340
::
317341
$ ls $(cabal path --installdir)

0 commit comments

Comments
 (0)