aboutsummaryrefslogtreecommitdiffstats
path: root/bruiser/CompletionHints.cpp
diff options
context:
space:
mode:
authorbloodstalker <thabogre@gmail.com>2018-04-28 23:14:42 +0000
committerbloodstalker <thabogre@gmail.com>2018-04-28 23:14:42 +0000
commite067db4d46626c6b2ab91c857c32e449f6f52c7f (patch)
tree337f6d5d8037c28b3614d1b861ae055aa0024bc4 /bruiser/CompletionHints.cpp
parentrelicensed everything excluding safercpp to GPL-3.0. fixes #31. now there is ... (diff)
downloadmutator-e067db4d46626c6b2ab91c857c32e449f6f52c7f.tar.gz
mutator-e067db4d46626c6b2ab91c857c32e449f6f52c7f.zip
ramdump is here
Diffstat (limited to 'bruiser/CompletionHints.cpp')
-rw-r--r--bruiser/CompletionHints.cpp35
1 files changed, 9 insertions, 26 deletions
diff --git a/bruiser/CompletionHints.cpp b/bruiser/CompletionHints.cpp
index 0afe094..d7a6dbb 100644
--- a/bruiser/CompletionHints.cpp
+++ b/bruiser/CompletionHints.cpp
@@ -25,25 +25,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.*
/*standard headers*/
#include <iostream>
#include <string>
-/*LLVM headers*/
/*other*/
#include "linenoise/linenoise.h"
/**********************************************************************************************************************/
-/*used namespaces*/
-/**********************************************************************************************************************/
-/*macros*/
-
-/**********************************************************************************************************************/
-namespace bruiser
-{
- void ShellCompletion(const char* __buf, linenoiseCompletions* __lc)
- {
- if (__buf != NULL)
- {
- for(auto &iter : LUA_FUNCS)
- {
- if (iter.find(__buf) == 0U)
- {
+namespace bruiser {
+ void ShellCompletion(const char* __buf, linenoiseCompletions* __lc) {
+ if (__buf != NULL) {
+ for(auto &iter : LUA_FUNCS) {
+ if (iter.find(__buf) != std::string::npos) {
linenoiseAddCompletion(__lc, iter.c_str());
}
}
@@ -52,19 +41,13 @@ namespace bruiser
char* ShellHints(const char* __buf, int* __color, int* __bold)
{
- if (__buf != NULL)
- {
+ if (__buf != NULL) {
auto dummy = std::string(__buf);
- for(auto &iter : LUA_FUNCS)
- {
- if (dummy == "")
- {
- break;
- }
+ for(auto &iter : LUA_FUNCS) {
+ if (dummy == "") break;
- if (iter.find(__buf) == 0U)
- {
+ if (iter.find(__buf) != std::string::npos) {
*__color = 35;
*__bold = 1;
int sizet = dummy.length();