flag to force scilab exit after -e or -f execution added. 57/16957/4
Cedric Delamarre [Mon, 3 Aug 2015 10:22:48 +0000 (12:22 +0200)]
Change-Id: I76434aee1238715ed40c66353a785511d4c8113f

scilab/bin/scilab
scilab/modules/core/help/en_US/scilab.xml
scilab/modules/core/help/fr_FR/scilab.xml
scilab/modules/core/help/ja_JP/scilab.xml
scilab/modules/core/help/pt_BR/scilab.xml
scilab/modules/core/help/ru_RU/scilab.xml
scilab/modules/core/includes/InitScilab.h
scilab/modules/core/src/cpp/InitScilab.cpp
scilab/modules/startup/src/cpp/scilab.cpp

index 1e4d67b..8be3776 100755 (executable)
@@ -962,6 +962,8 @@ do_help()
     echo     "                    -e and -f arguments are mutually exclusive."
     echo     "  -f File         : execute the scilab script given in File argument."
     echo     "                    -e and -f arguments are mutually exclusive."
+    echo     "  -quit           : force scilab exit after execution of script from -e or -f argument."
+    echo     "                    this flag is ignored if it is not used with -e or -f argument."
     echo     "  -l Lang         : set the current language. Lang can be equal to fr or en."
     echo     "  -nb             : do not display Scilab loading on start."
     echo     "  -ns             : do not execute scilab.start startup file. This argument will disable many features in Scilab (Only use if you know what you are doing)."
@@ -1068,7 +1070,7 @@ if test "$rest" = "yes"; then
                     exit 5
                 fi
                 ;;
-            --parse-trace|--pretty-print|--help|--AST-trace|--no-exec|--context-dump|--exec-verbose|--timed|--AST-timed|--serialize)
+            --parse-trace|--pretty-print|--help|--AST-trace|--no-exec|--context-dump|--exec-verbose|--timed|--AST-timed|--serialize|-quit)
            #This are Scilab6 dedicated options.
                    ;;
             -psn_*)
index 3fd9c32..38dcb69 100644 (file)
@@ -13,8 +13,8 @@
             scilab-cli <Options>
         </synopsis>
     </refsynopsisdiv>
-    <refsection>
-        <title>Description</title>
+    <refsection role="arguments">
+        <title>Arguments</title>
         <variablelist>
             <varlistentry>
                 <term>-args Arguments</term>
                 </listitem>
             </varlistentry>
             <varlistentry>
+                <term>-quit</term>
+                <listitem>
+                    This option forces scilab to always exit after the instruction(s) passed with the <literal>-e</literal>
+                    option, or the script referred to by the <literal>-f</literal> option, have been executed,
+                    even in case of a runtime error. This option should always be used in batch mode.
+                    It is ignored if neither <literal>-e</literal> nor <literal>-f</literal> options are present.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
                 <term>-l lang</term>
                 <listitem>
                     <para>If this option is present it fixes the user language.
             </varlistentry>
         </variablelist>
     </refsection>
-    <refsection>
+    <refsection role="description">
         <title>Description of environment variables</title>
         <variablelist>
             <varlistentry>
                 <term>SCIVERBOSE</term>
                 <listitem>
                     <para>
-                        If this variable is present, Scilab startup script will show a startup debug information. 
+                        If this variable is present, Scilab startup script will show a startup debug information.
                         Mainly used for bug report and debugging purposes.
                     </para>
                 </listitem>
                 <term>JAVA_HOME</term>
                 <listitem>
                     <para>
-                        Specify which Java to use. For example, 
+                        Specify which Java to use. For example,
                         <literal>JAVA_HOME=/usr/lib/jvm/java-7-openjdk/ scilab</literal> will start Scilab with Java 7.
                     </para>
                 </listitem>
             </varlistentry>
         </variablelist>
     </refsection>
-    <refsection>
+    <refsection role="description">
         <title>Java Virtual Machine options</title>
         <para>Starting from Scilab 5.0, the graphical user interface (GUI) and the
             build documentation are based on Java features. In some cases, it can be
             change look and feel, change memory managements... See: <ulink url="http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html">http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html</ulink>.
         </para>
     </refsection>
-    <refsection>
+    <refsection role="examples">
         <title>Examples</title>
-        <programlisting role="no-scilab-exec"><![CDATA[ 
+        <programlisting role="no-scilab-exec"><![CDATA[
 # Let's start Scilab in profiling mode without attaching a gdb once a SIGSEGV is met.
 # We are under Bash shell
 export SCILAB_VALGRIND_OPT="--db-attach=no --log-file=myfile.txt"
@@ -384,7 +394,7 @@ echo $? ]]></programlisting>
             </member>
         </simplelist>
     </refsection>
-    <refsection>
+    <refsection role="history">
         <title>History</title>
         <revhistory>
             <revision>
@@ -398,7 +408,7 @@ echo $? ]]></programlisting>
             <revision>
                 <revnumber>6.0.0</revnumber>
                 <revremark>
-                    <literal>-mem</literal> option removed.
+                    <literal>-quit</literal> option added. <literal>-mem</literal> option removed.
                 </revremark>
             </revision>
         </revhistory>
index f252d65..69947f3 100644 (file)
             scilab-cli &lt;Options&gt;
         </synopsis>
     </refsynopsisdiv>
-    <refsection>
-        <title>Description</title>
+    <refsection role="arguments">
+        <title>Paramètres</title>
         <variablelist>
             <varlistentry>
                 <term>-args arguments</term>
                 <listitem>
                     <para>si cette option est présente des arguments sont passés à
-                        Scilab. Ils peuvent être récupérés par la fonction 
+                        Scilab. Ils peuvent être récupérés par la fonction
                         <literal>
                             <link linkend="sciargs">sciargs</link>
                         </literal>
                         .Les arguments multiples
                         doivent être passés dans chaîne de caractères les contenant, séparés
-                        par des espaces <literal>scilab -args 'foo1 foo2';</literal>. 
+                        par des espaces <literal>scilab -args 'foo1 foo2';</literal>.
                         Sans cette option, les arguments inconnus ne seront pas acceptés.
                     </para>
                 </listitem>
                 </listitem>
             </varlistentry>
             <varlistentry>
+                <term>-quit</term>
+                <listitem>
+                    <para>Cette option force Scilab à quitter la session après l'exécution des instructions
+                    données par l'option <literal>-e</literal> ou par le script indiqué via l'option
+                    <literal>-f</literal>, y compris en cas d'erreur d'exécution.
+                    Cette option doit toujours être utilisée en mode batch. Elle est ignorée lorsque
+                    l'option <literal>-e</literal> ou <literal>-f</literal> n'est pas utilisée.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
                 <term>-l lang</term>
                 <listitem>
                     <para>Cette option permet de sélectionner la langue de
             </varlistentry>
         </variablelist>
     </refsection>
-    <refsection>
+    <refsection role="description">
         <title>Description des variables d'environnement</title>
         <variablelist>
             <varlistentry>
             </varlistentry>
         </variablelist>
     </refsection>
-    <refsection>
+    <refsection role="description">
         <title>Java Virtual Machine options</title>
         <para>A partir de la version 5.0 de Scilab, l'interface graphique et le
             système de génération de la documentation sont basés sur des
                     <para>Ces options activent de nombreuses vérifications, message de
                         débug et autres contrôles sur les appels JNI (appel natif Java). Ces
                         options sont utiles pour le débuggage et désactivée par défaut à
-                        cause de l'impact sur les performances. 
+                        cause de l'impact sur les performances.
                     </para>
                 </listitem>
             </varlistentry>
             De nombreuses options sont disponibles. Elles peuvent améliorer les performances, changer le rendu graphique, la gestion de la mémoire... Voir: <ulink url="http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html">http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html</ulink>
         </para>
     </refsection>
-    <refsection>
-        <title>Examples</title>
-        <programlisting role="example"> 
+    <refsection role="examples">
+        <title>Exemples</title>
+        <programlisting role="example">
             # Lançons Scilab en mode profilage sans qu'un gdb soit lancé à chaque SIGSEGV.
             # On est sous Bash
             export SCILAB_VALGRIND_OPT="--db-attach=no --log-file=myfile.txt"
             scilab -profiling
-            
+
             # Lançons Scilab en mode debug sans s'arrêter à chaque SIGSEGV
             # D'abord écrivons un petit fichier de commandes
             echo "handle SIGSEGV nostop" &amp;gt; debug.txt
             $ echo "disp(%pi)"|scilab-cli
             ou
             $ echo "disp(%pi)"|scilab -nwni
-            
+
             # Ouvre uniquement la fenêtre d'aide Scilab:
             $ scilab-adv-cli -e "help()"
             or
             $ scilab -nw -e "help()"
-            
-            
+
+
             # Scilab utilisé en tant que moteur de scripting
             echo "if 1&lt;&gt;2 then exit(99) end"|scilab-cli
-            echo $? 
+            echo $?
         </programlisting>
     </refsection>
     <refsection role="see also">
-        <title>See Also</title>
+        <title>Voir aussi</title>
         <simplelist type="inline">
             <member>
                 <link linkend="exit">exit</link>
             </member>
+            <member>
+                <link linkend="startup">startup</link>
+            </member>
         </simplelist>
     </refsection>
-    <refsection>
-        <title>History</title>
+    <refsection role="history">
+        <title>Historique</title>
         <revhistory>
             <revision>
                 <revnumber>5.4.0</revnumber>
                 <revremark>-noatomsautoload ajouté.</revremark>
             </revision>
         </revhistory>
+            <revision>
+                <revnumber>5.4.1</revnumber>
+                <revremark>scinotes et xcos peuvent maintenant être démarrés en ligne de commande. Voir le SEP #87.</revremark>
+            </revision>
+            <revision>
+                <revnumber>6.0.0</revnumber>
+                <revremark>
+                    Option <literal>-quit</literal> ajoutée. Option <literal>-mem</literal> supprimée.
+                </revremark>
+            </revision>
     </refsection>
 </refentry>
index 886a72c..40b9e27 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
 
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="scilab" xml:lang="ja">
-    
+
     <refnamediv>
-        
+
         <refname>scilab</refname>
-        
+
         <refpurpose>
-            
+
             Scilabおよび関連ツールを起動するためのツール
-            
+
             (GNU/Linux, Unix および Mac OS X)
-            
+
         </refpurpose>
-        
+
     </refnamediv>
-    
+
     <refsynopsisdiv>
-        
+
         <title>呼出し手順</title>
-        
+
         <synopsis>scilab &lt;Options&gt;
-            
+
             scilab-adv-cli &lt;Options&gt;
-            
+
             scilab-cli &lt;Options&gt;
-            
+
         </synopsis>
-        
+
     </refsynopsisdiv>
-    
-    <refsection>
-        
-        <title>説明</title>
-        
+
+    <refsection role="arguments">
+
+        <title>説定</title>
+
         <variablelist>
-            
+
             <varlistentry>
-                
+
                 <term>-args Arguments</term>
-                
+
                 <listitem>
-                    
+
                     <para>
-                        
+
                         このオプションが存在する場合,引数がScilabに渡されます.
-                        
+
                         これらは,<link linkend="sciargs">sciargs</link>関数で取得することが
-                        
+
                         できます.
-                        
+
                         複数の引数を指定する場合,以下のように一連の複数の単語を引用符で括り,
-                        
-                        空白で分割してください: <literal>scilab -args 'foo1 foo2'</literal>. 
-                        
+
+                        空白で分割してください: <literal>scilab -args 'foo1 foo2'</literal>.
+
                         このオプションを指定しない場合,未知の引数は受け付けられません.
-                        
+
                     </para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+
                 <term>-display Display</term>
-                
+
                 <listitem>
-                    
+
                     <para>
-                        
+
                         Xwindow システム上でのみ使用可能で, 表示する
-                        
+
                         Xサーバーを指定します.
-                        
+
                         デフォルトの表示先は unix:0.0 です.
-                        
+
                     </para>
-                    
+
                     <para>
-                        
+
                         <literal>-display</literal> は,
-                        
+
                         <literal>-d</literal>と短縮形で指定できます.
-                        
+
                     </para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+
                 <term>-debug</term>
-                
+
                 <listitem>
-                    
+
                     <para>デバッガgdb上でScilabを開始します(Unix/Linux/Mac OS Xのみ).</para>
-                    
+
                     <para>
-                        
+
                         gdb にカスタムオプションを追加する場合,
-                        
+
                         変数<literal>SCILAB_GDB_OPT</literal>を定義します.
-                        
+
                     </para>
-                    
+
                     <para>助言: このオプションをScilabソースツリー上で使用してください.</para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+
                 <term>-debug-kdbg</term>
-                
+
                 <listitem>
-                    
+
                     <para>kdbg上でScilabを開始します (Unix/Linux/Mac OS X のみ).</para>
-                    
+
                     <para>助言: このオプションをScilabソースツリー上で使用してください.</para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+
                 <term>-profiling</term>
-                
+
                 <listitem>
-                    
+
                     <para>valgrind上でScilabを開始します (Unix/Linux/Mac OS X のみ).</para>
-                    
+
                     <para>
-                        
+
                         valgrind にカスタムオプションを追加する場合
-                        
+
                         (および既存の valgrind オプションを上書きする場合),SCILAB_VALGRIND_OPT
-                        
+
                         を定義してください.
-                        
+
                     </para>
-                    
+
                     <para>助言: このオプションをScilabソースツリー上で使用してください.</para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+
                 <term>-profiling-visu</term>
-                
+
                 <listitem>
-                    
+
                     <para>callgrind上でScilabを開始します (Unix/Linux/Mac OS X のみ).</para>
-                    
+
                     <para>
-                        
+
                         callgrind にカスタムオプションを追加する場合
-                        
+
                         (および既存の callgrind オプションを上書きする場合),SCILAB_VALGRIND_OPT
-                        
+
                         を定義してください.
-                        
+
                     </para>
-                    
+
                     <para>助言: このオプションをScilabソースツリー上で使用してください.</para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+
                 <term>-electric-fence</term>
-                
+
                 <listitem>
-                    
+
                     <para>Electric Fence を指定して Scilab を開始します(Unix/Linux/Mac OS Xのみ).</para>
-                    
+
                     <para>助言: このオプションをScilabソースツリー上で使用してください.</para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+
                 <term>-e 命令</term>
-                
+
                 <listitem>
-                    
+
                     <para>
-                        
+
                         このオプションを指定すると Scilab 命令
-                        
+
                         <literal>Instruction</literal> が(スタートアップファイルの実行直後に)
-                        
+
                         まずScilabで実行されます.
-                        
+
                         <literal>-e</literal> および
-                        
+
                         <literal>-f</literal> オプションは相互に排他的です.
-                        
+
                     </para>
-                    
+
                     <para>
                         <literal>-e</literal>により複数の命令を指定できることに注意してください.
                     </para>
-                    
+
                     <programlisting role="no-scilab-exec">scilab-cli -e  "a=1+%i; aPlusPi=a+%pi; disp(aPlusPi);exit;" -nb</programlisting>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+
                 <term>-f file</term>
-                
+
                 <listitem>
-                    
+
                     <para>
-                        
+
                         このオプションを指定すると, Scilab はスクリプト <literal>file</literal>
-                        
+
                         を(スタートアップファイルの実行直後,)Scilab上で最初に実行します.
-                        
-                        
-                        
+
+
+
                         <literal>-e</literal> および
-                        
+
                         <literal>-f</literal> オプションは相互に排他的です.
-                        
+
                     </para>
-                    
+
                     <para>.xcos 拡張子を有するファイルはXcosで開かれます.</para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+                <term>-quit</term>
+                <listitem>
+                    This option forces scilab to always exit after the instruction(s) passed with the <literal>-e</literal>
+                    option, or the script referred to by the <literal>-f</literal> option, have been executed,
+                    even in case of a runtime error. This option should always be used in batch mode.
+                    It is ignored if neither <literal>-e</literal> nor <literal>-f</literal> options are present.
+                    </para>
+                </listitem>
+            </varlistentry>
+
+            <varlistentry>
+
                 <term>-l lang</term>
-                
+
                 <listitem>
-                    
+
                     <para>このオプションを指定した場合,
-                        
+
                         ユーザ言語を指定します.
-                        
+
                         <emphasis>lang</emphasis> は以下の値を指定できます: <emphasis>ca_ES de_DE en_US es_ES
-                            
+
                             fr_FR ja_JP pt_BR ru_RU zh_CN zh_TW
-                            
+
                         </emphasis>
-                        
+
                         (Scilab 5.2以降).
-                        
+
                     </para>
-                    
+
                     <para>
-                        
+
                         互換性維持のため,その他に <literal>lang</literal> の値は,フランス語として
-                        
+
                         <literal>'fr'</literal> および英語として <literal>'en'</literal> を使用可能です.
-                        
+
                         デフォルト値は,<literal>scilab.start</literal>ファイルで指定されます.
-                        
+
                     </para>
-                    
+
                     <para>いくつかのシステムでは,UTF-8フォントを正しく描画するために,
-                        
+
                         ロケールをコンパイルする必要があります.
-                        
+
                     </para>
-                    
+
                     <para>Scilab を以下のようにコールすることも可能です:</para>
-                    
+
                     <programlisting role="no-scilab-exec">LANG=ja_JP scilab
-                        
+
                         # これは以下と等価です
-                        
+
                         scilab -l ja_JP
-                        
+
                     </programlisting>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+
                 <term>-nb</term>
-                
+
                 <listitem>
-                    
+
                     <para>
-                        
+
                         このオプションが指定された場合, Scilabの Welcome バナーは表示されません.
-                        
+
                     </para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+
                 <term>-ns</term>
-                
+
                 <listitem>
-                    
+
                     <para>
-                        
+
                         このオプションが指定された場合, スタートアップファイル
-                        
+
                         <literal>SCI/etc/scilab.start</literal> およびユーザスタートアップファイル
-                        
+
                         <literal>SCIHOME/.scilab</literal>,
-                        
+
                         <literal>SCIHOME/scilab.ini</literal> は実行されません.
-                        
+
                     </para>
-                    
+
                     <para>このオプションは, Scilabの多くの機能を無効にします (動作を理解している場合のみ
-                        
+
                         使用してください).
-                        
+
                     </para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+
                 <term>-nouserstartup</term>
-                
+
                 <listitem>
-                    
+
                     <para>このオプションが指定された場合, スタートアップファイル
-                        
+
                         <literal>SCIHOME/.scilab</literal>,
-                        
+
                         <literal>SCIHOME/scilab.ini</literal> は実行されません.
-                        
+
                     </para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+
                 <term>-noatomsautoload</term>
-                
+
                 <listitem>
-                    
+
                     <para>
-                        
+
                         このオプションが指定された場合,イントール済みのATOMモジュールは
-                        
+
                         このセッションでロードされません.
-                        
+
                     </para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+
                 <term>-nw</term>
-                
+
                 <listitem>
-                    
+
                     <para>
-                        
+
                         このオプションが指定された場合, Scilab は
-                        
+
                         先進的な機能(グラフィック, export, xcos, scinotes, ヘルプブラウザ, ...)
-                        
+
                         と共にコマンドラインで起動されます.
-                        
+
                     </para>
-                    
+
                     <para>
                         このオプションは <literal>-f</literal>または <literal>-e</literal>
-                        
+
                         オプションと同時に指定することができます.
                     </para>
-                    
+
                     <para>Scilab 5.2以降:</para>
-                    
+
                     <itemizedlist>
-                        
+
                         <listitem>
-                            
+
                             <para>Scilab のディストリビューションには,
-                                
-                                <literal>-nw</literal>と同様のバイナリを提供します: 
-                                
+
+                                <literal>-nw</literal>と同様のバイナリを提供します:
+
                                 <literal>scilab-adv-cli</literal>
-                                
+
                                 (Scilab Advanced Command Line Interpreter).
-                                
+
                             </para>
-                            
+
                         </listitem>
-                        
+
                         <listitem>
-                            
+
                             <para>全てのオペレーティングシステムについて
-                                
+
                                 パイプが有効です (詳細については例を参照ください).
-                                
+
                             </para>
-                            
+
                         </listitem>
-                        
+
                     </itemizedlist>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+
                 <term>-nwni / -nogui</term>
-                
+
                 <listitem>
-                    
+
                     <para>このオプションが指定された場合, Scilab は先進的な機能
-                        
+
                         (グラフィック, export, xcos, scinotes, ヘルプブラウザ, ...)なしで
-                        
+
                         コマンドラインで起動されます.
-                        
+
                     </para>
-                    
+
                     <para>
                         このオプションは <literal>-f</literal> または <literal>-e</literal>
-                        
+
                         オプションと同時に指定することができます.
                     </para>
-                    
+
                     <para>Scilab 5.2以降:</para>
-                    
+
                     <itemizedlist>
-                        
+
                         <listitem>
-                            
+
                             <para>
-                                
+
                                 Scilab のディストリビューションでは,
-                                
+
                                 <literal>-nwni</literal>と同じ専用バイナリが提供されています
-                                
+
                                 : <literal>scilab-cli</literal>
-                                
+
                                 (Scilab Command Line Interpreter).
-                                
+
                             </para>
-                            
+
                         </listitem>
-                        
+
                     </itemizedlist>
-                    
+
                     <itemizedlist>
-                        
+
                         <listitem>
-                            
+
                             <para>全てのオペレーティングシステムについて
-                                
+
                                 パイプが有効です (詳細については例を参照ください).
-                                
+
                             </para>
-                            
+
                         </listitem>
-                        
+
                     </itemizedlist>
-                    
+
                     <para>このモードでは Java 仮想マシンはロードされません.
-                        
+
                         (起動は高速化され,メモリ消費量は減少します)
-                        
+
                     </para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+
                 <term>--texmacs</term>
-                
+
                 <listitem>
-                    
+
                     <para>このオプションは TeXMacs用に予約されています.</para>
-                    
+
                     <para>
-                        
+
                         ATOMSモジュールをインストールしてください: <programlisting role="">atomsInstall('texmacs')</programlisting>
-                        
+
                     </para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+
                 <term>-version</term>
-                
+
                 <listitem>
-                    
+
                     <para>このオプションはプロダクトのバージョンを出力し,終了します.</para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
         </variablelist>
-        
+
     </refsection>
-    
-    <refsection>
-        
+
+    <refsection role="description">
+
         <title>環境変数の説明</title>
-        
+
         <variablelist>
-            
+
             <varlistentry>
-                
+
                 <term>SCIVERBOSE</term>
-                
+
                 <listitem>
-                    
+
                     <para>
-                        
+
                         この変数が存在した場合, Scilab起動スクリプトは起動時デバッグ情報を表示します.
-                        
+
                         主にバグレポートおよびデバッグ目的で使用されます.
-                        
+
                     </para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+
                 <term>JAVA_HOME</term>
-                
+
                 <listitem>
-                    
+
                     <para>
-                        
+
                         使用するJavaを指定します. 例えば,
-                        
+
                         <literal>JAVA_HOME=/usr/lib/jvm/java-7-openjdk/ scilab</literal> は
-                        
+
                         Java 7 でScilabを起動します.
-                        
+
                     </para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+
                 <term>SCI_DISABLE_TK</term>
-                
+
                 <listitem>
-                    
+
                     <para>Tk (Tclではなく) 機能を無効にします.</para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+
                 <term>SCI_JAVA_ENABLE_HEADLESS</term>
-                
+
                 <listitem>
-                    
+
                     <para>
-                        
+
                         ヘッドレスJava仮想マシン (すなわち,GUI機能なし).
-                        
+
                     </para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
         </variablelist>
-        
+
     </refsection>
-    
-    <refsection>
-        
+
+    <refsection role="description">
+
         <title>Java 仮想マシンオプション</title>
-        
+
         <para>Scilab 5.0以降, グラフィカルユーザインターフェイス (GUI) および
-            
+
             ドキュメントの構築は,Java機能に基づいています.
-            
+
             いくつかのケースでは,
-            
+
             JVM (Java仮想マシン)オプションを編集することが重要となります.
-            
+
         </para>
-        
+
         <para>これらのオプションは,
-            
+
             <emphasis>jvm_options.xml</emphasis>ファイルで利用可能です.
-            
+
         </para>
-        
+
         <para>5.0.X および 5.1.Xでは, このファイルは
-            
+
             <emphasis>SCI/modules/jvm/etc/jvm_options.xml</emphasis>に保存されています.
-            
+
         </para>
-        
+
         <para>&gt;= 5.2.0以降, このファイルは
-            
+
             <emphasis>
-                
+
                 etc/jvm_options.xml<emphasis> </emphasis>
-                
+
             </emphasis>
-            
+
             にあります.
-            
+
         </para>
-        
+
         <para>デフォルトで, 以下の3つのオプションが
-            
+
             設定ファイルで容易にアクセス可能です:
-            
+
         </para>
-        
+
         <variablelist>
-            
+
             <varlistentry>
-                
+
                 <term>-XmxXXXm</term>
-                
+
                 <listitem>
-                    
+
                     <para>
-                        
+
                         このオプションは,Java仮想マシンで利用可能なメモリ量を設定します.
-                        
+
                         デフォルトで, 256M が確保されます.
-                        
+
                         この値を変更した場合, その値がシステムで利用可能なメモリを
-                        
+
                         超えないことを確認してください.
-                        
+
                     </para>
-                    
+
                     <para>
-                        
+
                         Scilab 5.4.0以降, この値は設定メニュー内で変更可能です.
-                        
+
                     </para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+
                 <term>-Djava.compiler=JIT</term>
-                
+
                 <listitem>
-                    
+
                     <para>
-                        
+
                         このオプションを引数<emphasis>JIT</emphasis>を付けて指定すると,
-                        
+
                         Java Just In Time compilerが有効になります.
-                        
+
                         このオプションはデフォルトで有効となります.
-                        
+
                         <emphasis>NONE</emphasis>によりJITは無効となり,
-                        
+
                         著しく性能が低下します.
-                        
+
                     </para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
             <varlistentry>
-                
+
                 <term>-verbose:jni / -Xcheck:jni</term>
-                
+
                 <listitem>
-                    
+
                     <para>
-                        
+
                         これらのオプションは,JNIコールとその出力をより詳細に確認します.
-                        
+
                         デバッグ時にはこれらのオプションを利用可能ですが,
-                        
+
                         性能を低下させるためデフォルトでは無効となっています.
-                        
+
                     </para>
-                    
+
                 </listitem>
-                
+
             </varlistentry>
-            
+
         </variablelist>
-        
+
         <para>より多くのオプションが利用可能です.
-            
+
             これにより性能を改善したり,ルックアンドフィールを変更したり,
-            
+
             メモリ管理を変更したりといったことが可能です.
-            
+
             参照:  <ulink url="http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html">http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html</ulink>
-            
+
         </para>
-        
+
     </refsection>
-    
-    <refsection>
-        
+
+    <refsection role="examples">
+
         <title>例</title>
-        
-        <programlisting role="no-scilab-exec"><![CDATA[ 
+
+        <programlisting role="no-scilab-exec"><![CDATA[
 # Let's start Scilab in profiling mode without attaching a gdb once a SIGSEGV is met.
 # We are under Bash shell
 export SCILAB_VALGRIND_OPT="--db-attach=no --log-file=myfile.txt"
@@ -756,7 +767,7 @@ echo "handle SIGSEGV nostop" &> debug.txt
 export SCILAB_GDB_OPT="--command=debug.txt"
 # Start Scilab in debug mode
 scilab -debug]]></programlisting>
-        
+
         <programlisting role="no-scilab-exec"><![CDATA[
 # Under GNU/Linux, Mac OS X or Unix:
 $ echo "disp(%pi)"|scilab-cli
@@ -772,56 +783,61 @@ $ scilab -nw -e "help()"
 # Scilab can be used for scripting aspects:
 echo "if 1<>2 then exit(99) end"|scilab-cli
 echo $? ]]></programlisting>
-        
+
     </refsection>
-    
+
     <refsection role="see also">
-        
+
         <title>参照</title>
-        
+
         <simplelist type="inline">
-            
+
             <member>
-                
+
                 <link linkend="exit">exit</link>
-                
+
             </member>
-            
+
             <member>
-                
+
                 <link linkend="startup">startup</link>
-                
+
             </member>
-            
+
         </simplelist>
-        
+
     </refsection>
-    
-    <refsection>
-        
+
+    <refsection role="history">
+
         <title>履歴</title>
-        
+
         <revhistory>
-            
+
             <revision>
-                
+
                 <revnumber>5.4.0</revnumber>
-                
+
                 <revremark>-noatomsautoload が追加されました.</revremark>
-                
+
             </revision>
-            
+
             <revision>
-                
+
                 <revnumber>5.4.1</revnumber>
-                
+
                 <revremark>scinotes と xcos 個別スクリプトが導入されました. SEP #87参照.</revremark>
-                
+
+            </revision>
+            <revision>
+                <revnumber>6.0.0</revnumber>
+                <revremark>
+                    <literal>-quit</literal> option added. <literal>-mem</literal> option removed.
+                </revremark>
             </revision>
-            
         </revhistory>
-        
+
     </refsection>
-    
+
 </refentry>
 
index e2a2713..e970625 100644 (file)
@@ -1,24 +1,24 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="scilab" xml:lang="en">
+<?xml version="1.0" encoding="UTF-8"?>
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="scilab" xml:lang="pt">
     <refnamediv>
         <refname>scilab</refname>
         <refpurpose>principal script para executar o Scilab e ferramentas de
-            miscelânea
+            miscelânea
         </refpurpose>
     </refnamediv>
     <refsynopsisdiv>
-        <title>Sqeüência de Chamamento</title>
+        <title>Sqeüência de Chamamento</title>
         <synopsis>scilab &lt;Options&gt;</synopsis>
     </refsynopsisdiv>
-    <refsection>
-        <title>Descrição</title>
+    <refsection role="arguments">
+        <title>Parâmetros</title>
         <variablelist>
             <varlistentry>
                 <term>-args Arguments</term>
                 <listitem>
-                    <para>Se esta opção estiver presente, os argumentos são passados ao
-                        Scilab. Eles podem ser recebidos pela função <link linkend="sciargs">sciargs</link>. para passagem de múltiplos
-                        argumentos use, seqüências de palavras separadas por espaços entre
+                    <para>Se esta opção estiver presente, os argumentos são passados ao
+                        Scilab. Eles podem ser recebidos pela função <link linkend="sciargs">sciargs</link>. para passagem de múltiplos
+                        argumentos use, seqüências de palavras separadas por espaços entre
                         aspas simples: <literal>scilab -args 'foo1 foo2'</literal>
                     </para>
                 </listitem>
@@ -27,7 +27,7 @@
                 <term>-display Display</term>
                 <listitem>
                     <para>Para uso apenas em sistemas Xwindow para ajustar um display de
-                        servidor X. O display padrão é unix:0.0
+                        servidor X. O display padrão é unix:0.0
                     </para>
                     <para>
                         <literal>-display</literal> pode ser abreviado por
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>-e Instrução</term>
+                <term>-e Instrução</term>
                 <listitem>
-                    <para>Se esta opção estiver presente, então a instrução Scilab
-                        <literal>Instrução</literal> é executada primeiro (logo após a
-                        execução do arquivo de inicialização) no Scilab. As opções
-                        <literal>-e</literal> e <literal>-f</literal> são mutuamente
+                    <para>Se esta opção estiver presente, então a instrução Scilab
+                        <literal>Instrução</literal> é executada primeiro (logo após a
+                        execução do arquivo de inicialização) no Scilab. As opções
+                        <literal>-e</literal> e <literal>-f</literal> são mutuamente
                         exclusivas
                     </para>
                 </listitem>
             <varlistentry>
                 <term>-f arquivo</term>
                 <listitem>
-                    <para>Se esta opção estiver presente, então o script Scilab
-                        <literal>arquivo</literal> é executado primeiro (logo após a
-                        execução do arquivo de inicialização) no Scilab. As opções
-                        <literal>-e</literal> e <literal>-f</literal> são mutuamente
+                    <para>Se esta opção estiver presente, então o script Scilab
+                        <literal>arquivo</literal> é executado primeiro (logo após a
+                        execução do arquivo de inicialização) no Scilab. As opções
+                        <literal>-e</literal> e <literal>-f</literal> são mutuamente
                         exclusivas.
                     </para>
                 </listitem>
             </varlistentry>
             <varlistentry>
+                <term>-quit</term>
+                <listitem>
+                    This option forces scilab to always exit after the instruction(s) passed with the <literal>-e</literal>
+                    option, or the script referred to by the <literal>-f</literal> option, have been executed,
+                    even in case of a runtime error. This option should always be used in batch mode.
+                    It is ignored if neither <literal>-e</literal> nor <literal>-f</literal> options are present.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
                 <term>-l idioma</term>
                 <listitem>
-                    <para>Se esta opção estiver presente, ela fica o idioma do usuário.
-                        Os possíveis valores para <literal>idioma</literal> são
-                        <literal>'fr'</literal> para francês, <literal>'en'</literal> para
-                        inglês e 'br' para português brasileiro. O idioma padrão é inglês. O
-                        valor padrão é fixado no arquivo
+                    <para>Se esta opção estiver presente, ela fica o idioma do usuário.
+                        Os possíveis valores para <literal>idioma</literal> são
+                        <literal>'fr'</literal> para francês, <literal>'en'</literal> para
+                        inglês e 'br' para português brasileiro. O idioma padrão é inglês. O
+                        valor padrão é fixado no arquivo
                         <literal>scilab.start</literal>.
                     </para>
                 </listitem>
             <varlistentry>
                 <term>-nb</term>
                 <listitem>
-                    <para>Se esta opção está presente, então o cartão de boas-vindas não
-                        é impresso.
+                    <para>Se esta opção está presente, então o cartão de boas-vindas não
+                        é impresso.
                     </para>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>-ns</term>
                 <listitem>
-                    <para>Se esta opção está presente, o arquivo de inicialização
+                    <para>Se esta opção está presente, o arquivo de inicialização
                         <literal>SCI/etc/scilab.start</literal> e os arquivos de
-                        inicialização do usuário <literal>SCIHOME/.scilab</literal>,
-                        <literal>SCIHOME/scilab.ini</literal> não são executados.
+                        inicialização do usuário <literal>SCIHOME/.scilab</literal>,
+                        <literal>SCIHOME/scilab.ini</literal> não são executados.
                     </para>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>-nouserstartup</term>
                 <listitem>
-                    <para>Se esta opção estiver presente, os arquivos de inicialização
-                        do usuário <literal>SCIHOME/.scilab</literal>,
-                        <literal>SCIHOME/scilab.ini</literal> não são executados.
+                    <para>Se esta opção estiver presente, os arquivos de inicialização
+                        do usuário <literal>SCIHOME/.scilab</literal>,
+                        <literal>SCIHOME/scilab.ini</literal> não são executados.
                     </para>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>-nw</term>
                 <listitem>
-                    <para>Se esta opção estiver presente, então o Scilab não é executado
-                        em uma janela específica.
+                    <para>Se esta opção estiver presente, então o Scilab não é executado
+                        em uma janela específica.
                     </para>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>-nwni / -nogui</term>
                 <listitem>
-                    <para>Se esta opção estiver presente, então o Scilab não é executado
-                        em uma janela específica e não aceita interação do usuário. Esta
-                        opção pode ser utilizada com as opções -f ou -e .
+                    <para>Se esta opção estiver presente, então o Scilab não é executado
+                        em uma janela específica e não aceita interação do usuário. Esta
+                        opção pode ser utilizada com as opções -f ou -e .
                     </para>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>--texmacs</term>
                 <listitem>
-                    <para>Esta opção é reservada para TexMacs.</para>
+                    <para>Esta opção é reservada para TexMacs.</para>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>-version</term>
                 <listitem>
-                    <para>Esta opção imprime a versão do produto e sai.</para>
+                    <para>Esta opção imprime a versão do produto e sai.</para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection role="description">
+        <title>Description of environment variables</title>
+        <variablelist>
+            <varlistentry>
+                <term>SCIVERBOSE</term>
+                <listitem>
+                    <para>
+                        If this variable is present, Scilab startup script will show a startup debug information.
+                        Mainly used for bug report and debugging purposes.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>JAVA_HOME</term>
+                <listitem>
+                    <para>
+                        Specify which Java to use. For example,
+                        <literal>JAVA_HOME=/usr/lib/jvm/java-7-openjdk/ scilab</literal> will start Scilab with Java 7.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>SCI_DISABLE_TK</term>
+                <listitem>
+                    <para>Disable Tk (but not Tcl) features.</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>SCI_JAVA_ENABLE_HEADLESS</term>
+                <listitem>
+                    <para>
+                        Enable Java Headless VM (i.e. without GUI features).
+                    </para>
+                </listitem>
+            </varlistentry>
+        </variablelist>
+    </refsection>
+    <refsection role="description">
+        <title>Java Virtual Machine options</title>
+        <para>Starting from Scilab 5.0, the graphical user interface (GUI) and the
+            build documentation are based on Java features. In some cases, it can be
+            important to edit the JVM options (Java Virtual Machine).
+        </para>
+        <para>These options are available in the
+            <emphasis>jvm_options.xml</emphasis> file.
+        </para>
+        <para>In version 5.0.X and 5.1.X, this file is stored as
+            <emphasis>SCI/modules/jvm/etc/jvm_options.xml</emphasis>.
+        </para>
+        <para>In version &gt;= 5.2.0, the file is available in
+            <emphasis>etc/jvm_options.xml</emphasis>.
+        </para>
+        <para>
+            <emphasis>
+                By default, the three following options are
+                easily accessible in the configuration file:
+            </emphasis>
+        </para>
+        <variablelist>
+            <varlistentry>
+                <term>-XmxXXXm</term>
+                <listitem>
+                    <para>This option set the amount of memory available by the Java
+                        Virtual Machine. By default, 256M are allocated. If you change this
+                        value, check that the value does not exceed the memory available on
+                        the system.
+                    </para>
+                    <para>Since Scilab 5.4.0, this value can be changed in the preferences menu.</para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>-Djava.compiler=JIT</term>
+                <listitem>
+                    <para>
+                        This option with the argument <emphasis>JIT</emphasis> enables
+                        the Java Just In Time compiler. It is activated by default.
+                        <emphasis>NONE</emphasis> disables the JIT and decreases
+                        dramatically performances.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>-verbose:jni / -Xcheck:jni</term>
+                <listitem>
+                    <para>These options enable more checks and output from the JNI
+                        calls. These options are useful in case of debugging and are
+                        disabled by default since they decreases performances.
+                    </para>
                 </listitem>
             </varlistentry>
         </variablelist>
+        <para>Many more options are available. They can improve the performances,
+            change look and feel, change memory managements... See: <ulink url="http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html">http://www.oracle.com/technetwork/java/javase/tech/vmoptions-jsp-140102.html</ulink>.
+        </para>
+    </refsection>
+    <refsection role="examples">
+        <title>Exemplos</title>
+        <programlisting role="no-scilab-exec"><![CDATA[
+# Let's start Scilab in profiling mode without attaching a gdb once a SIGSEGV is met.
+# We are under Bash shell
+export SCILAB_VALGRIND_OPT="--db-attach=no --log-file=myfile.txt"
+scilab -profiling
+
+# Let's start Scilab in debug mode without stopping after each SIGSEGV
+# First, we write a small command file
+echo "handle SIGSEGV nostop" &> debug.txt
+# Now set the custom option
+# We are under Bash shell
+export SCILAB_GDB_OPT="--command=debug.txt"
+# Start Scilab in debug mode
+scilab -debug]]></programlisting>
+        <programlisting role="no-scilab-exec"><![CDATA[
+# Under GNU/Linux, Mac OS X or Unix:
+$ echo "disp(%pi)"|scilab-cli
+or
+$ echo "disp(%pi)"|scilab -nwni
+
+# Only open the Scilab help window:
+$ scilab-adv-cli -e "help()"
+or
+$ scilab -nw -e "help()"
+
+
+# Scilab can be used for scripting aspects:
+echo "if 1<>2 then exit(99) end"|scilab-cli
+echo $? ]]></programlisting>
+    </refsection>
+    <refsection role="see also">
+        <title>Ver também</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="exit">exit</link>
+            </member>
+            <member>
+                <link linkend="startup">startup</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection role="history">
+        <title>Histórico</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.4.0</revnumber>
+                <revremark>-noatomsautoload added.</revremark>
+            </revision>
+            <revision>
+                <revnumber>5.4.1</revnumber>
+                <revremark>scinotes and xcos individual scripts introduced. See SEP #87.</revremark>
+            </revision>
+            <revision>
+                <revnumber>6.0.0</revnumber>
+                <revremark>
+                    <literal>-quit</literal> option added. <literal>-mem</literal> option removed.
+                </revremark>
+            </revision>
+        </revhistory>
     </refsection>
 </refentry>
index 7af5656..d3a658d 100644 (file)
             scilab-cli &lt;Options&gt;
         </synopsis>
     </refsynopsisdiv>
-    <refsection>
-        <title>Описание</title>
+    <refsection role="arguments">
+        <title>Аргументы</title>
         <variablelist>
             <varlistentry>
                 <term>-args Arguments</term>
                 <listitem>
                     <para>
                         Если есть эта опция, то в Scilab передаются аргументы <literal>Arguments</literal>.
-                        Они могут затем быть получены с помощью функции 
-                        <link linkend="sciargs">sciargs</link>. Для множества передаваемых 
-                        аргументов используйте кавычки и разделяйте слова пробелами. Например, 
-                        <literal>scilab -args 'foo1 foo2'</literal>. Без этого неизвестные 
+                        Они могут затем быть получены с помощью функции
+                        <link linkend="sciargs">sciargs</link>. Для множества передаваемых
+                        аргументов используйте кавычки и разделяйте слова пробелами. Например,
+                        <literal>scilab -args 'foo1 foo2'</literal>. Без этого неизвестные
                         аргументы не будут приняты.
                     </para>
                 </listitem>
@@ -49,7 +49,7 @@
                         Запуск Scilab'а в отладчике gdb (только Unix/Linux/Mac OS X).
                     </para>
                     <para>
-                        Определите переменную  <literal>SCILAB_GDB_OPT</literal> для добавления 
+                        Определите переменную  <literal>SCILAB_GDB_OPT</literal> для добавления
                         пользовательских настроек в gdb.
                     </para>
                     <para>Совет: используйте эту опцию в дереве исходников Scilab'а.</para>
@@ -67,8 +67,8 @@
                 <listitem>
                     <para>Запуск Scilab'а в valgrind (только Unix/Linux/Mac OS X).</para>
                     <para>
-                        Определите переменную  <literal>SCILAB_VALGRIND_OPT</literal>  для 
-                        добавления пользовательских настроек в valgrind (и отмены существующих 
+                        Определите переменную  <literal>SCILAB_VALGRIND_OPT</literal>  для
+                        добавления пользовательских настроек в valgrind (и отмены существующих
                         опций valgrind).
                     </para>
                     <para>Совет: используйте эту опцию в дереве исходников Scilab'а.</para>
@@ -79,8 +79,8 @@
                 <listitem>
                     <para>Запуск Scilab'а в callgrind (только Unix/Linux/Mac OS X).</para>
                     <para>
-                        Определите переменную <literal>SCILAB_VALGRIND_OPT</literal> для 
-                        добавления пользовательских настроек в callgrind (и отмены существующих 
+                        Определите переменную <literal>SCILAB_VALGRIND_OPT</literal> для
+                        добавления пользовательских настроек в callgrind (и отмены существующих
                         опций callgrind).
                     </para>
                     <para>Совет: используйте эту опцию в дереве исходников Scilab'а.</para>
@@ -97,8 +97,8 @@
                 <term>-e Instruction</term>
                 <listitem>
                     <para>
-                        Если есть эта опция, то инструкция <literal>Instruction</literal> выполняется 
-                        первой (сразу же после исполнения файла запуска) в Scilab'e. Опции <literal>-e</literal> 
+                        Если есть эта опция, то инструкция <literal>Instruction</literal> выполняется
+                        первой (сразу же после исполнения файла запуска) в Scilab'e. Опции <literal>-e</literal>
                         и <literal>-f</literal> взаимоисключающие.
                     </para>
                     <para>
                 </listitem>
             </varlistentry>
             <varlistentry>
+                <term>-quit</term>
+                <listitem>
+                    This option forces scilab to always exit after the instruction(s) passed with the <literal>-e</literal>
+                    option, or the script referred to by the <literal>-f</literal> option, have been executed,
+                    even in case of a runtime error. This option should always be used in batch mode.
+                    It is ignored if neither <literal>-e</literal> nor <literal>-f</literal> options are present.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
                 <term>-l lang</term>
                 <listitem>
                     <para>
                         (начиная с Scilab 5.2).
                     </para>
                     <para>
-                        Другими возможными значениями <literal>lang</literal> (для совместимости) являются <literal>'fr'</literal> 
+                        Другими возможными значениями <literal>lang</literal> (для совместимости) являются <literal>'fr'</literal>
                         для французского и <literal>'en'</literal> для английского языка. По умолчанию язык английский.
                         Это значение по умолчанию зафиксировано в файле <literal>scilab.start</literal>.
                     </para>
                 <term>-ns</term>
                 <listitem>
                     <para>
-                        Если есть эта опция, то файл запуска <literal>SCI/etc/scilab.start</literal> и пользовательские 
+                        Если есть эта опция, то файл запуска <literal>SCI/etc/scilab.start</literal> и пользовательские
                         файлы запуска <literal>SCIHOME/.scilab</literal> и <literal>SCIHOME/scilab.ini</literal> не исполняются.
                     </para>
                     <para>
                 <term>-nouserstartup</term>
                 <listitem>
                     <para>
-                        Если есть эта опция, то пользовательские файлы запуска <literal>SCIHOME/.scilab</literal> и 
+                        Если есть эта опция, то пользовательские файлы запуска <literal>SCIHOME/.scilab</literal> и
                         <literal>SCIHOME/scilab.ini</literal> не исполняются.
                     </para>
                 </listitem>
                         <listitem>
                             <para>
                                 Дистрибутив Scilab также предоставляет специальный бинарный файл, который
-                                делает то же, что и <literal>-nw</literal>: <literal>scilab-adv-cli</literal> 
+                                делает то же, что и <literal>-nw</literal>: <literal>scilab-adv-cli</literal>
                                 (Интерпретатор Scilab с улучшенной командной строкой).
                             </para>
                         </listitem>
                         <listitem>
                             <para>
                                 Дистрибутив Scilab также предоставляет специальный бинарный файл, который
-                                делает то же, что и <literal>-nwni</literal>: <literal>scilab-cli</literal> 
+                                делает то же, что и <literal>-nwni</literal>: <literal>scilab-cli</literal>
                                 (Интерпретатор Scilab с улучшенной командной строкой).
                             </para>
                         </listitem>
             </varlistentry>
         </variablelist>
     </refsection>
-    <refsection>
+    <refsection role="description">
         <title>Описание переменных окружения</title>
         <variablelist>
             <varlistentry>
                 <term>JAVA_HOME</term>
                 <listitem>
                     <para>
-                        Определяет какую Java использовать. Например, 
+                        Определяет какую Java использовать. Например,
                         <literal>JAVA_HOME=/usr/lib/jvm/java-7-openjdk/ scilab</literal> запустить Scilab с Java 7.
                     </para>
                 </listitem>
             </varlistentry>
         </variablelist>
     </refsection>
-    <refsection>
+    <refsection role="description">
         <title>Опции виртуальной машины Java</title>
         <para>
-            Начиная с Scilab 5.0, графический пользовательский интерфейс (GUI) и встроенная 
+            Начиная с Scilab 5.0, графический пользовательский интерфейс (GUI) и встроенная
             документация основаны на возможностях Java. В некоторых случаях может оказаться
             важным править опции JVM (Виртуальная Машина Java).
         </para>
             Эти опции доступны в файле <emphasis>jvm_options.xml</emphasis>.
         </para>
         <para>
-            В версиях 5.0.X и 5.1.X этот файл хранится как 
+            В версиях 5.0.X и 5.1.X этот файл хранится как
             <emphasis>SCI/modules/jvm/etc/jvm_options.xml</emphasis>.
         </para>
         <para>
-            В версии &gt;= 5.2.0 этот файл доступен в 
+            В версии &gt;= 5.2.0 этот файл доступен в
             <emphasis>
                 etc/jvm_options.xml
             </emphasis>
                 <term>-Djava.compiler=JIT</term>
                 <listitem>
                     <para>
-                        Эта опция с аргументом <emphasis>JIT</emphasis> задействует оперативный 
-                        Java-компилятор (JIT). Он включается по умолчанию. <emphasis>NONE</emphasis> отключает 
+                        Эта опция с аргументом <emphasis>JIT</emphasis> задействует оперативный
+                        Java-компилятор (JIT). Он включается по умолчанию. <emphasis>NONE</emphasis> отключает
                         оперативный Java-компилятор и чрезвычайно уменьшает производительность.
                     </para>
                 </listitem>
                 <term>-verbose:jni / -Xcheck:jni</term>
                 <listitem>
                     <para>
-                        Эти опции задействуют больше проверок и выход из вызовов интерфейса для прямого 
+                        Эти опции задействуют больше проверок и выход из вызовов интерфейса для прямого
                         доступа из Java. Эти опции полезны в случае отладки и по умолчанию отключены, поскольку они уменьшают производительность.
                     </para>
                 </listitem>
             </varlistentry>
         </variablelist>
         <para>
-            Доступно очень много опций. Они могут улучшить производительность, поменять взгляды и 
+            Доступно очень много опций. Они могут улучшить производительность, поменять взгляды и
             отношение, изменить способы управления памятью... Смотрите:: <ulink url="http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp">http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp</ulink>
             или <ulink url="http://blogs.sun.com/watt/resource/jvm-options-list.html">http://blogs.sun.com/watt/resource/jvm-options-list.html</ulink>.
         </para>
     </refsection>
-    <refsection>
+    <refsection role="examples">
         <title>Примеры</title>
-        <programlisting role="example"><![CDATA[ 
+        <programlisting role="example"><![CDATA[
 # Запустим Scilab в режиме профилирования без прикрепления gdb после каждого SIGSEGV.
 # Мы находимся в оболочке Bash
 export SCILAB_VALGRIND_OPT="--db-attach=no --log-file=myfile.txt"
 scilab -profiling
+
 # Запустим Scilab в режиме отладки без остановки после каждого SIGSEGV
 # Сначала запишем небольшой файл команд
 echo "handle SIGSEGV nostop" &> debug.txt
@@ -381,13 +391,13 @@ scilab -debug
 $ echo "disp(%pi)"|scilab-cli
 или
 $ echo "disp(%pi)"|scilab -nwni
+
 # Открыть только окно справки Scilab:
 $ scilab-adv-cli -e "help()"
 или
 $ scilab -nw -e "help()"
+
+
 # Scilab может быть использован написания сценариев:
 echo "if 1<>2 then exit(99) end"|scilab-cli
 echo $? ]]></programlisting>
@@ -403,7 +413,7 @@ echo $? ]]></programlisting>
             </member>
         </simplelist>
     </refsection>
-    <refsection>
+    <refsection role="history">
         <title>История</title>
         <revhistory>
             <revision>
@@ -413,10 +423,16 @@ echo $? ]]></programlisting>
             <revision>
                 <revnumber>5.4.1</revnumber>
                 <revremark>
-                    введены отдельные сценарии scinotes и xcos. 
+                    введены отдельные сценарии scinotes и xcos.
                     См.SEP #87.
                 </revremark>
             </revision>
+            <revision>
+                <revnumber>6.0.0</revnumber>
+                <revremark>
+                    <literal>-quit</literal> option added. <literal>-mem</literal> option removed.
+                </revremark>
+            </revision>
         </revhistory>
     </refsection>
 </refentry>
index 4ee3e08..5188732 100644 (file)
@@ -41,6 +41,7 @@ typedef struct
     int isPrioritary;
     int isConsoleCommand;
     int iStartConsoleThread;
+    int iForceQuit;
 } ScilabEngineInfo;
 
 ScilabEngineInfo* InitScilabEngineInfo();
index 7602a0f..dca9491 100644 (file)
@@ -126,6 +126,7 @@ ScilabEngineInfo* InitScilabEngineInfo()
     pSEI->isInterruptible = 1;      // by default all thread are interruptible
     pSEI->isPrioritary = 0;         // by default all thread are non-prioritary
     pSEI->iStartConsoleThread = 1;  // used in call_scilab to avoid "prompt" thread execution
+    pSEI->iForceQuit = 0;           // management of -quit argument
 
     return pSEI;
 }
@@ -134,7 +135,16 @@ int StartScilabEngine(ScilabEngineInfo* _pSEI)
 {
     int iMainRet = 0;
     ConfigVariable::setStartProcessing(true);
-    ConfigVariable::setForceQuit(false);
+
+    // ignore -e argument if the command is empty
+    if (_pSEI->pstExec && strcmp(_pSEI->pstExec, "") == 0)
+    {
+        _pSEI->pstExec = NULL;
+    }
+
+    // ignore -quit if -e or -f are not given
+    _pSEI->iForceQuit = _pSEI->iForceQuit && (_pSEI->pstExec || _pSEI->pstFile);
+    ConfigVariable::setForceQuit(_pSEI->iForceQuit);
 
     /* This bug only occurs under Linux 32 bits
      * See: http://wiki.scilab.org/Scilab_precision
@@ -506,7 +516,7 @@ void* scilabReadAndExecCommand(void* param)
 
     ScilabEngineInfo* _pSEI = (ScilabEngineInfo*)param;
 
-    while (ConfigVariable::getForceQuit() == false)
+    do
     {
         if (GetCommand(&command, &iInterruptibleCmd, &iPrioritaryCmd, &iConsoleCmd) == 0)
         {
@@ -543,6 +553,7 @@ void* scilabReadAndExecCommand(void* param)
         processCommand(_pSEI);
         FREE(command);
     }
+    while (ConfigVariable::getForceQuit() == false);
 
     return NULL;
 }
@@ -705,6 +716,12 @@ static int interactiveMain(ScilabEngineInfo* _pSEI)
         }
     }
 
+    // -e -quit with parser error, command queue is empty
+    if (_pSEI->iForceQuit && isEmptyCommandQueue())
+    {
+        return 1;
+    }
+
     __threadId threadIdConsole;
     __threadKey threadKeyConsole;
     __threadId threadIdCommand;
index a98159e..d1b4f7d 100644 (file)
@@ -61,7 +61,12 @@ extern "C"
 static void usage(void)
 {
     std::cerr << "Usage: Scilab <options>" << std::endl;
-    std::cerr << "      -f file          : Batch mode on the given file." << std::endl;
+    std::cerr << "      -e Instruction   : execute the scilab instruction given in Instruction argument.";
+    std::cerr << "                         -e and -f arguments are mutually exclusive.";
+    std::cerr << "      -f File          : execute the scilab script given in File argument.";
+    std::cerr << "                         -e and -f arguments are mutually exclusive.";
+    std::cerr << "      -quit            : force scilab exit after execution of script from -e or -f argument.";
+    std::cerr << "                         this flag is ignored if it is not used with -e or -f argument.";
     std::cerr << "      -l lang          : Change the language of scilab ( default : en_US )." << std::endl;
     std::cerr << "      -nw              : Enable console mode." << std::endl;
     std::cerr << "      -nwni            : Enable terminal mode." << std::endl;
@@ -144,6 +149,10 @@ static int get_option(const int argc, char *argv[], ScilabEngineInfo* _pSEI)
                 _pSEI->pstParseFile = argv[i];
             }
         }
+        else if (!strcmp("-quit", argv[i]))
+        {
+            _pSEI->iForceQuit = 1;
+        }
         else if (!strcmp("-version", argv[i]))
         {
             i++;