poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[COMMITTED] poke: -s does not imply non-interactive mode


From: Jose E. Marchesi
Subject: [COMMITTED] poke: -s does not imply non-interactive mode
Date: Sun, 14 Feb 2021 18:39:48 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

commit 50f83a82b00e063be5d53941d33a634320101027
Author: Jose E. Marchesi <jose.marchesi@oracle.com>
Date:   Sun Feb 14 18:38:19 2021 +0100

    poke: -s does not imply non-interactive mode
    
    Also, this patch makes poke to source the given command files after
    sourcing the user initialization file(s) pokerc.
    
    2021-02-14  Jose E. Marchesi  <jemarch@gnu.org>
    
            * poke/poke.c (parse_args_2): -s doesn't imply that poke runs
            non-interactively.
            (main): Load user configuration file before handling -s arguments.
            (parse_args_1): Handle NO_INIT_FILE_ARG here instead of
            parse_args_2.
            (parse_args_1): Likewise for QUIET_ARG.

diff --git a/ChangeLog b/ChangeLog
index b1af9646..701b84e3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2021-02-14  Jose E. Marchesi  <jemarch@gnu.org>
+
+       * poke/poke.c (parse_args_2): -s doesn't imply that poke runs
+       non-interactively.
+       (main): Load user configuration file before handling -s arguments.
+       (parse_args_1): Handle NO_INIT_FILE_ARG here instead of
+       parse_args_2.
+       (parse_args_1): Likewise for QUIET_ARG.
+
 2021-02-08  David Faust  <david.faust@oracle.com>
 
        * libbpoke/pkl-anal.c: Forbid anonymous members in unions.
diff --git a/poke/poke.c b/poke/poke.c
index 17030f2a..de12d14a 100644
--- a/poke/poke.c
+++ b/poke/poke.c
@@ -382,6 +382,10 @@ parse_args_1 (int argc, char *argv[])
         case NO_HSERVER_ARG:
           poke_no_hserver_arg = 1;
           break;
+        case 'q':
+        case NO_INIT_FILE_ARG:
+          poke_load_init_file = 0;
+          break;
         default:
           break;
         }
@@ -416,10 +420,6 @@ parse_args_2 (int argc, char *argv[])
           poke_quiet_p = 1;
           pk_set_quiet_p (poke_compiler, 1);
           break;
-        case 'q':
-        case NO_INIT_FILE_ARG:
-          poke_load_init_file = 0;
-          break;
         case 'l':
         case LOAD_ARG:
           if (pk_compile_file (poke_compiler, optarg,
@@ -437,7 +437,6 @@ parse_args_2 (int argc, char *argv[])
         case 's':
         case SOURCE_ARG:
           {
-            poke_interactive_p = 0;
             if (!pk_cmd_exec_script (optarg))
               goto exit_failure;
             break;
@@ -460,6 +459,8 @@ parse_args_2 (int argc, char *argv[])
         case MI_ARG:
         case NO_AUTO_MAP_ARG:
         case NO_HSERVER_ARG:
+        case 'q':
+        case NO_INIT_FILE_ARG:
           /* These are handled in parse_args_1.  */
           break;
           /* libtextstyle arguments are handled in pk-term.c, not
@@ -686,14 +687,14 @@ main (int argc, char *argv[])
   /* Initialization.  */
   initialize (argc, argv);
 
-  /* Second round of argument parsing: loading files, opening files
-     for IO, etc etc */
-  parse_args_2 (argc, argv);
-
   /* User's initialization.  */
   if (poke_load_init_file)
     initialize_user ();
 
+  /* Second round of argument parsing: loading files, opening files
+     for IO, etc etc */
+  parse_args_2 (argc, argv);
+
   /* Enter the REPL or MI.  */
   if (poke_mi_p)
     {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]