shell: added completion support
This commit is contained in:
@@ -1,5 +1,10 @@
|
||||
#include "shell.h"
|
||||
|
||||
char** s_completion(const char* text, int start, int end) {
|
||||
rl_attempted_completion_over = 1;
|
||||
return rl_completion_matches(text, s_names);
|
||||
}
|
||||
|
||||
void s_die(const char* msg) {
|
||||
fprintf(stderr, "s: %s\n", msg);
|
||||
exit(1);
|
||||
@@ -72,6 +77,8 @@ int s_exec(char** args) {
|
||||
}
|
||||
|
||||
void s_loop() {
|
||||
rl_attempted_completion_function = s_completion;
|
||||
|
||||
char** cmd;
|
||||
int s;
|
||||
|
||||
|
Reference in New Issue
Block a user