Commit 02df7297 authored by Alexandru Dura's avatar Alexandru Dura
Browse files

Add a no prompt option (-n) to the shell

parent 8c0a3e01
...@@ -328,11 +328,15 @@ static void init_search_path(void) ...@@ -328,11 +328,15 @@ static void init_search_path(void)
/* main: main program of simple shell. */ /* main: main program of simple shell. */
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
char* prompt = (argc >= 2 &&
!strncmp(argv[1], "-n", 3))
? "" : "% ";
progname = argv[0]; progname = argv[0];
init_search_path(); init_search_path();
while (fetch_line("% ") != EOF) while (fetch_line(prompt) != EOF)
parse_line(); parse_line();
return 0; return 0;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment