|
@@ -29,6 +29,7 @@ struct _context {
|
|
|
static bool_t clish_shell_tinyrl_key_help(tinyrl_t * this, int key)
|
|
|
{
|
|
|
bool_t result = BOOL_TRUE;
|
|
|
+
|
|
|
if (BOOL_TRUE == tinyrl_is_quoting(this)) {
|
|
|
|
|
|
result = tinyrl_insert_text(this, "?");
|
|
@@ -55,8 +56,7 @@ static bool_t clish_shell_tinyrl_key_help(tinyrl_t * this, int key)
|
|
|
|
|
|
Pointer paramter 'this' could be declared as pointing to const */
|
|
|
static char *clish_shell_tinyrl_word_generator(tinyrl_t * this,
|
|
|
- const char *line,
|
|
|
- unsigned offset, unsigned state)
|
|
|
+ const char *line, unsigned offset, unsigned state)
|
|
|
{
|
|
|
|
|
|
context_t *context = tinyrl__get_context(this);
|
|
@@ -77,7 +77,7 @@ static clish_pargv_status_t clish_shell_tinyrl_expand(tinyrl_t * this)
|
|
|
|
|
|
|
|
|
rtn = tinyrl_history_expand(tinyrl__get_history(this),
|
|
|
- tinyrl__get_line(this), &buffer);
|
|
|
+ tinyrl__get_line(this), &buffer);
|
|
|
|
|
|
switch (rtn) {
|
|
|
case -1:
|
|
@@ -120,34 +120,28 @@ static tinyrl_match_e clish_shell_tinyrl_complete(tinyrl_t * this)
|
|
|
|
|
|
|
|
|
(void)clish_shell_tinyrl_expand(this);
|
|
|
-
|
|
|
|
|
|
status = tinyrl_complete(this);
|
|
|
-
|
|
|
switch (status) {
|
|
|
case TINYRL_NO_MATCH:
|
|
|
- {
|
|
|
- if (BOOL_FALSE == tinyrl_is_completion_error_over(this)) {
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- break;
|
|
|
+ if (BOOL_FALSE == tinyrl_is_completion_error_over(this)) {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
+ break;
|
|
|
case TINYRL_MATCH:
|
|
|
case TINYRL_MATCH_WITH_EXTENSIONS:
|
|
|
case TINYRL_COMPLETED_MATCH:
|
|
|
case TINYRL_AMBIGUOUS:
|
|
|
case TINYRL_COMPLETED_AMBIGUOUS:
|
|
|
- {
|
|
|
-
|
|
|
- * necessary
|
|
|
- */
|
|
|
- break;
|
|
|
- }
|
|
|
+
|
|
|
+ * necessary
|
|
|
+ */
|
|
|
+ break;
|
|
|
}
|
|
|
return status;
|
|
|
}
|
|
@@ -302,10 +296,10 @@ static char **clish_shell_tinyrl_completion(tinyrl_t * this,
|
|
|
|
|
|
|
|
|
tinyrl_completion_over(this);
|
|
|
-
|
|
|
|
|
|
matches = tinyrl_completion(this,
|
|
|
line, start, end, clish_shell_tinyrl_word_generator);
|
|
|
+
|
|
|
return matches;
|
|
|
}
|
|
|
|
|
@@ -338,10 +332,9 @@ tinyrl_t *clish_shell_tinyrl_new(FILE * istream,
|
|
|
|
|
|
tinyrl_t *this = tinyrl_new(istream,
|
|
|
ostream, stifle, clish_shell_tinyrl_completion);
|
|
|
- if (NULL != this) {
|
|
|
-
|
|
|
+
|
|
|
+ if (this)
|
|
|
clish_shell_tinyrl_init(this);
|
|
|
- }
|
|
|
return this;
|
|
|
}
|
|
|
|
|
@@ -357,7 +350,6 @@ void clish_shell_tinyrl_delete(tinyrl_t * this)
|
|
|
{
|
|
|
|
|
|
clish_shell_tinyrl_fini(this);
|
|
|
-
|
|
|
|
|
|
tinyrl_delete(this);
|
|
|
}
|