diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2020-07-05 18:38:38 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-05 16:11:49 +0200 |
commit | ddbdd0e68617f7e09d5b07496de216d120630bf8 (patch) | |
tree | 2ba1394222cbf4c292ca2eb032ba72a84b3013c4 /Shell | |
parent | 9cc32d6e9588685b452f1bccbc77e9389056a052 (diff) | |
download | serenity-ddbdd0e68617f7e09d5b07496de216d120630bf8.zip |
Shell: Do not remove more than 2 dashes from the option being completed
This makes '------inl' a completion request for an option named
'----inl' instead of 'inl'.
Diffstat (limited to 'Shell')
-rw-r--r-- | Shell/Shell.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Shell/Shell.cpp b/Shell/Shell.cpp index f10c1b9069..063d335725 100644 --- a/Shell/Shell.cpp +++ b/Shell/Shell.cpp @@ -831,7 +831,7 @@ Vector<Line::CompletionSuggestion> Shell::complete_user(const String& name, size Vector<Line::CompletionSuggestion> Shell::complete_option(const String& program_name, const String& option, size_t offset) { size_t start = 0; - while (start < option.length() && option[start] == '-') + while (start < option.length() && option[start] == '-' && start < 2) ++start; auto option_pattern = offset > start ? option.substring_view(start, offset - start) : ""; editor->suggest(offset); |