@@ -288,19 +288,43 @@ cabal preferences. It is very useful when you are e.g. first configuring
288
288
cabal path
289
289
^^^^^^^^^^
290
290
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.
295
294
296
295
::
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
+ }
304
328
305
329
If ``cabal path `` is passed a single option naming a path, then that
306
330
path will be printed *without * any label:
@@ -310,8 +334,8 @@ path will be printed *without* any label:
310
334
$ cabal path --installdir
311
335
/home/haskell/.local/bin
312
336
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:
315
339
316
340
::
317
341
$ ls $(cabal path --installdir)
0 commit comments