summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-04-03 13:35:09 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-08-02 04:10:18 -0400
commit266a74528a2550a03d66f3d726d65b47df612446 (patch)
tree5029cd07164f21fdfcf10a84a51a8f3b7a281af8 /docs
parent54d6b20192fe6fc244248c7766533a768c591bae (diff)
downloadhaskell-266a74528a2550a03d66f3d726d65b47df612446.tar.gz
ghc: Introduce --run mode
As described in #18011, this mode provides similar functionality to the `runhaskell` command, but doesn't require that the user know the path of yet another executable, simplifying interactions with upstream tools.
Diffstat (limited to 'docs')
-rw-r--r--docs/users_guide/using.rst14
1 files changed, 14 insertions, 0 deletions
diff --git a/docs/users_guide/using.rst b/docs/users_guide/using.rst
index 6660dfa4d5..ce6f22e95a 100644
--- a/docs/users_guide/using.rst
+++ b/docs/users_guide/using.rst
@@ -265,6 +265,20 @@ The available mode flags are:
Interactive mode, which is also available as :program:`ghci`. Interactive
mode is described in more detail in :ref:`ghci`.
+.. ghc-flag:: --run ⟨file⟩
+ :shortdesc: Run a Haskell program.
+ :type: mode
+ :category: modes
+
+ .. index::
+ single: run mode
+ single: GHCi
+
+ Run a script's ``main`` entry-point. Similar to ``runghc`` this will by
+ default use the bytecode interpreter. If the command-line contains a ``--``
+ argument then all arguments that follow will be passed to the script. All
+ arguments that precede ``--`` are interpreted as GHC arguments.
+
.. ghc-flag:: --make
:shortdesc: Build a multi-module Haskell program, automatically figuring out
dependencies. Likely to be much easier, and faster, than using