aboutsummaryrefslogtreecommitdiff
path: root/src/suite
diff options
context:
space:
mode:
authorCharles Cabergs <me@cacharle.xyz>2020-09-12 11:04:21 +0200
committerCharles Cabergs <me@cacharle.xyz>2020-09-12 11:04:21 +0200
commit75f6b134911e378cb384e41fd0b9f717341acb2d (patch)
tree2563065b514e314769c673f541cbcc40eb999298 /src/suite
parentd66394dc10517af4578e80d626dc903a3cdece79 (diff)
downloadminishell_test-75f6b134911e378cb384e41fd0b9f717341acb2d.tar.gz
minishell_test-75f6b134911e378cb384e41fd0b9f717341acb2d.tar.bz2
minishell_test-75f6b134911e378cb384e41fd0b9f717341acb2d.zip
Added recording, Fixing no autocomplete on exact match
Diffstat (limited to 'src/suite')
-rw-r--r--src/suite/suite.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/suite/suite.py b/src/suite/suite.py
index c482c64..ee13268 100644
--- a/src/suite/suite.py
+++ b/src/suite/suite.py
@@ -6,7 +6,7 @@
# By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2020/07/15 18:24:29 by charles #+# #+# #
-# Updated: 2020/09/12 10:38:16 by charles ### ########.fr #
+# Updated: 2020/09/12 10:53:42 by charles ### ########.fr #
# #
# ############################################################################ #
@@ -32,12 +32,16 @@ class Suite:
if len(asked_names) == 0:
asked_names = [s.name for s in cls.available]
+ suite_names = [s.name for s in cls.available]
names = []
for i, name in enumerate(asked_names):
- matches = [s.name for s in cls.available
- if s.name.find("/") != -1
- and s.name[s.name.find("/") + 1:].startswith(name)
- or s.name.startswith(name)]
+ if name in suite_names:
+ names.append(name)
+ continue
+ matches = [n for n in suite_names
+ if n.find("/") != -1
+ and n[n.find("/") + 1:].startswith(name)
+ or n.startswith(name)]
if len(matches) == 1:
names.append(matches[0])
elif len(matches) != 0 and all([n.startswith(name) for n in matches]):