Mercurial > jwe > qt-gui-with-push-parser
annotate main.cpp @ 9:822a2fe5bb51
move command window to separate file and other refactoring
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 23 May 2019 12:36:26 -0400 |
parents | 08df60a01bc1 |
children |
rev | line source |
---|---|
0 | 1 #include <string> |
2 | |
3 #include <readline/history.h> | |
4 | |
5 #include "gui-main.h" | |
6 #include "tty-main.h" | |
7 | |
8 int | |
9 main (int argc, char **argv) | |
10 { | |
9
822a2fe5bb51
move command window to separate file and other refactoring
John W. Eaton <jwe@octave.org>
parents:
1
diff
changeset
|
11 bool tty_mode = false; |
822a2fe5bb51
move command window to separate file and other refactoring
John W. Eaton <jwe@octave.org>
parents:
1
diff
changeset
|
12 |
0 | 13 int new_argc = 0; |
14 | |
15 char **new_argv = new char* [argc + 1]; | |
16 | |
17 new_argv[new_argc++] = argv[0]; | |
18 | |
19 for (int i = 1; i < argc; i++) | |
20 { | |
21 if (argv[i] == std::string ("--tty")) | |
9
822a2fe5bb51
move command window to separate file and other refactoring
John W. Eaton <jwe@octave.org>
parents:
1
diff
changeset
|
22 tty_mode = true; |
0 | 23 else |
24 new_argv[new_argc++] = argv[i]; | |
25 } | |
26 | |
9
822a2fe5bb51
move command window to separate file and other refactoring
John W. Eaton <jwe@octave.org>
parents:
1
diff
changeset
|
27 int status = tty_mode |
822a2fe5bb51
move command window to separate file and other refactoring
John W. Eaton <jwe@octave.org>
parents:
1
diff
changeset
|
28 ? calc::tty_main (new_argc, new_argv) |
822a2fe5bb51
move command window to separate file and other refactoring
John W. Eaton <jwe@octave.org>
parents:
1
diff
changeset
|
29 : calc::gui_main (new_argc, new_argv); |
0 | 30 |
31 delete [] new_argv; | |
32 | |
33 return status; | |
34 } |