|
@@ -222,14 +222,7 @@ int main(int argc, char **argv)
|
|
|
if (log)
|
|
|
clish_shell__set_log(shell, log);
|
|
|
|
|
|
-
|
|
|
- running = clish_shell_startup(shell);
|
|
|
- if (running) {
|
|
|
- fprintf(stderr, "Cannot startup clish.\n");
|
|
|
- clish_shell_delete(shell);
|
|
|
- return -1;
|
|
|
- }
|
|
|
-
|
|
|
+
|
|
|
if(optind < argc) {
|
|
|
int i;
|
|
|
|
|
@@ -237,8 +230,19 @@ int main(int argc, char **argv)
|
|
|
clish_shell_push_file(shell, argv[i], stop_on_error);
|
|
|
} else {
|
|
|
|
|
|
- clish_shell_push_fd(shell, fdopen(dup(fileno(stdin)), "r"), stop_on_error);
|
|
|
+ clish_shell_push_fd(shell, fdopen(dup(fileno(stdin)), "r"),
|
|
|
+ stop_on_error);
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ running = clish_shell_startup(shell);
|
|
|
+ if (running) {
|
|
|
+ fprintf(stderr, "Cannot startup clish.\n");
|
|
|
+ clish_shell_delete(shell);
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
result = clish_shell_loop(shell);
|
|
|
|
|
|
|