Tweak some help text.
This commit is contained in:
parent
857219a4e8
commit
32a2254da9
|
@ -599,8 +599,9 @@ int _readFile(FILE* input, struct Environment* env)
|
||||||
void repl(struct Environment* env)
|
void repl(struct Environment* env)
|
||||||
{
|
{
|
||||||
char* buf;
|
char* buf;
|
||||||
using_history();
|
|
||||||
Object prompt;
|
Object prompt;
|
||||||
|
using_history();
|
||||||
|
|
||||||
while ((buf = readline((prompt = fetchFromEnvironment("prompt", env)).string)) != NULL) {
|
while ((buf = readline((prompt = fetchFromEnvironment("prompt", env)).string)) != NULL) {
|
||||||
cleanObject(&prompt);
|
cleanObject(&prompt);
|
||||||
if (strcmp("q", buf) == 0) {
|
if (strcmp("q", buf) == 0) {
|
||||||
|
@ -617,14 +618,14 @@ void repl(struct Environment* env)
|
||||||
free(oldBuf);
|
free(oldBuf);
|
||||||
}
|
}
|
||||||
Object o = parseEval(buf, env);
|
Object o = parseEval(buf, env);
|
||||||
|
free(buf);
|
||||||
|
|
||||||
size_t length;
|
size_t length;
|
||||||
char *output = stringObj(&o, &length);
|
char *output = stringObj(&o, &length);
|
||||||
printColored(output);
|
|
||||||
printf("[0m\n");
|
|
||||||
|
|
||||||
cleanObject(&o);
|
cleanObject(&o);
|
||||||
|
printColored(output);
|
||||||
free(output);
|
free(output);
|
||||||
free(buf);
|
printf("[0m\n");
|
||||||
}
|
}
|
||||||
cleanObject(&prompt);
|
cleanObject(&prompt);
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ BASIC_OP(or);
|
||||||
|
|
||||||
tfn(catObjects,
|
tfn(catObjects,
|
||||||
({ NULL, isStringy }),
|
({ NULL, isStringy }),
|
||||||
"Concatenate string versions of the given objects.",
|
"Concatenate string representations of the given objects.",
|
||||||
"(cat \"Stuff: \" (1 2 3))", "Stuff: ( 1 2 3 )",
|
"(cat \"Stuff: \" (1 2 3))", "Stuff: ( 1 2 3 )",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -55,7 +55,7 @@ tfn(prepend,
|
||||||
|
|
||||||
tfn(len,
|
tfn(len,
|
||||||
({ isListy, isNumber }),
|
({ isListy, isNumber }),
|
||||||
"Returns the length of the given list, or a NOT_A_LIST error if the expression is not a list.",
|
"Returns the length of the given list, or an error if the expression is not a list.",
|
||||||
"(len (2 3))", "2",
|
"(len (2 3))", "2",
|
||||||
"(len ())", "0",
|
"(len ())", "0",
|
||||||
"(len \"string\")", "BAD_PARAMS_ON: len",
|
"(len \"string\")", "BAD_PARAMS_ON: len",
|
||||||
|
|
|
@ -2,10 +2,9 @@
|
||||||
|
|
||||||
fn(startServer,
|
fn(startServer,
|
||||||
"(serve) => 0\n"
|
"(serve) => 0\n"
|
||||||
"Starts a simple web server with routes that have been added with (get) and (post).\n"
|
"Starts a simple web server with routes that have been added using (get) and (post).\n"
|
||||||
"Returns 0 if the server was successfully started, otherwise 1.\n"
|
"Returns 0 if the server was successfully started, otherwise 1.\n"
|
||||||
"Note: This is a non-blocking call. It is recommended to wait for some input before exiting.\n"
|
"Note: Not a blocking call! Calling (inp) is a simple way to keep the server open.\n"
|
||||||
" A simple way would be to use (inp) immediately after the (serve) call."
|
|
||||||
);
|
);
|
||||||
|
|
||||||
fn(addGetRoute,
|
fn(addGetRoute,
|
||||||
|
|
Loading…
Reference in New Issue