From 936fa7abb58a41e8262ab84c74b9a58dc6af4633 Mon Sep 17 00:00:00 2001 From: Mike Pilgrem Date: Wed, 20 Mar 2024 20:00:45 +0000 Subject: [PATCH] Fix #5615 Improve documentation of stack run --- doc/run_command.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/doc/run_command.md b/doc/run_command.md index 5f24a3f5fe..f0aaeda298 100644 --- a/doc/run_command.md +++ b/doc/run_command.md @@ -9,20 +9,22 @@ stack run [-- ARGUMENT(S) (e.g. stack run -- file.txt)] ~~~ `stack run` builds a project executable and runs it. If the command has a first -argument and it is recognised as an executable target then that is built. -Otherwise, the project's first executable is built. If the project has no -executables Stack reports no executables found as an error. +argument and it is recognised as the name of an executable component of a +project package then that is built. Otherwise, the project's first executable is +built. If the project has no executables Stack reports no executables found as +an error. !!! note - To identify a project's first executable, Stack lists the executable - components, in order, for each package, listed in order. For example: + To identify a project's first executable, and search for the name of an + executable component, Stack lists the executable components, in order, for + each package, listed in order. For example: `packageA:a-exe` < `packageA:b-exe` < `packageB:a-exe` < `packageB:b-exe` Everything after `--` on the command line is interpreted as a command line argument to be passed to what is run, other than a first argument recognised as -an executable target. +the name of an executable component of a project package. By default: