@@ -436,13 +436,15 @@ See `the v2-build section <#cabal-v2-build>`__ for the target syntax.
436
436
437
437
When ``TARGET `` is one of the following:
438
438
439
- - A component target: execute the specified executable, benchmark or test suite
439
+ - A component target: execute the specified executable, benchmark or test suite.
440
440
441
441
- A package target:
442
442
1. If the package has exactly one executable component, it will be selected.
443
443
2. If the package has multiple executable components, an error is raised.
444
444
3. If the package has exactly one test or benchmark component, it will be selected.
445
- 4. Otherwise an issue is raised
445
+ 4. Otherwise an issue is raised.
446
+
447
+ - The path to a script: execute the script at the path.
446
448
447
449
- Empty target: Same as package target, implicitly using the package from the current
448
450
working directory.
@@ -458,8 +460,8 @@ have to separate them with ``--``.
458
460
459
461
$ cabal v2-run target -- -a -bcd --argument
460
462
461
- ``v2-run `` also supports running script files that use a certain format. With
462
- a script that looks like:
463
+ ``v2-run `` supports running script files that use a certain format.
464
+ Scripts look like:
463
465
464
466
::
465
467
@@ -484,13 +486,12 @@ Only some fields are supported in the metadata blocks, and these fields are
484
486
currently not validated. See
485
487
`#8024 <https://github.com/haskell/cabal/issues/8024 >`__ for details.
486
488
487
- It can either be executed like any other script, using `` cabal `` as an
488
- interpreter, or through this command:
489
+ A script can either be executed directly using `cabal ` as an interpreter or
490
+ with the command:
489
491
490
492
::
491
493
492
494
$ cabal v2-run path/to/script
493
- $ cabal v2-run path/to/script -- --arg1 # args are passed like this
494
495
495
496
The executable is cached under the cabal directory, and can be pre-built with
496
497
``cabal v2-build path/to/script `` and the cache can be removed with
0 commit comments