diff -r 874555896035 -r 80aaa4ff7fed src/Doc/System/Environment.thy --- a/src/Doc/System/Environment.thy Sat Nov 19 20:10:32 2016 +0100 +++ b/src/Doc/System/Environment.thy Sun Nov 20 15:53:07 2016 +0100 @@ -214,8 +214,8 @@ \<^item> \<^verbatim>\etc/settings\ holds additional settings that are initialized when bootstrapping the overall Isabelle environment, cf.\ \secref{sec:boot}. As - usual, the content is interpreted as a \<^verbatim>\bash\ script. It may refer to the - component's enclosing directory via the \<^verbatim>\COMPONENT\ shell variable. + usual, the content is interpreted as a GNU bash script. It may refer to + the component's enclosing directory via the \<^verbatim>\COMPONENT\ shell variable. For example, the following setting allows to refer to files within the component later on, without having to hardwire absolute paths: @@ -260,9 +260,12 @@ text \ The main \<^emph>\Isabelle tool wrapper\ provides a generic startup environment for - Isabelle related utilities, user interfaces etc. Such tools automatically - benefit from the settings mechanism. All Isabelle command-line tools are - invoked via a common wrapper --- @{executable_ref isabelle}: + Isabelle-related utilities, user interfaces, add-on applications etc. Such + tools automatically benefit from the settings mechanism + (\secref{sec:settings}). Moreover, this is the standard way to invoke + Isabelle/Scala functionality as a separate operating-system process. + Isabelle command-line tools are run uniformly via a common wrapper --- + @{executable_ref isabelle}: @{verbatim [display] \Usage: isabelle TOOL [ARGS ...] @@ -271,12 +274,32 @@ Available tools: ...\} - In principle, Isabelle tools are ordinary executable scripts that are run - within the Isabelle settings environment, see \secref{sec:settings}. The set - of available tools is collected by @{executable isabelle} from the - directories listed in the @{setting ISABELLE_TOOLS} setting. Do not try to - call the scripts directly from the shell. Neither should you add the tool - directories to your shell's search path! + Tools may be implemented in Isabelle/Scala or as stand-alone executables + (usually as GNU bash scripts). In the invocation of ``@{executable + isabelle}~\tool\'', the named \tool\ is resolved as follows (and in the + given order). + + \<^enum> An external tool found on the directories listed in the @{setting + ISABELLE_TOOLS} settings variable (colon-separated list in standard POSIX + notation). + + \<^enum> If a file ``\tool\\<^verbatim>\.scala\'' is found, the source needs to define + some object that extends the class \<^verbatim>\Isabelle_Tool.Body\. The Scala + compiler is invoked on the spot (which may take some time), and the body + function is run with the command-line arguments as \<^verbatim>\List[String]\. + + \<^enum> If an executable file ``\tool\'' is found, it is invoked as + stand-alone program with the command-line arguments provided as \<^verbatim>\argv\ + array. + + \<^enum> An internal tool that is registered in \<^verbatim>\Isabelle_Tool.internal_tools\ + within the Isabelle/Scala namespace of \<^verbatim>\Pure.jar\. This is the preferred + entry-point for high-end tools implemented in Isabelle/Scala --- compiled + once when the Isabelle distribution is built. These tools are provided by + Isabelle/Pure and cannot be augmented in user-space. + + There are also some administrative tools that are available from a bare + repository clone of Isabelle, but not in regular distributions. \ @@ -346,7 +369,7 @@ loader within ML: @{verbatim [display] \isabelle process -e 'Thy_Info.get_theory "Main"'\} - Observe the delicate quoting rules for the Bash shell vs.\ ML. The + Observe the delicate quoting rules for the GNU bash shell vs.\ ML. The Isabelle/ML and Scala libraries provide functions for that, but here we need to do it manually. \