diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-09-12 10:40:17 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-09-12 10:40:17 +0200 |
| commit | d66394dc10517af4578e80d626dc903a3cdece79 (patch) | |
| tree | a37946809fbf728f1aa08c6e02d38b35290b568b /src/suite/suite.py | |
| parent | 387fe3441d2f1f02b8ff85e798eb1295f95b7e7f (diff) | |
| download | minishell_test-d66394dc10517af4578e80d626dc903a3cdece79.tar.gz minishell_test-d66394dc10517af4578e80d626dc903a3cdece79.tar.bz2 minishell_test-d66394dc10517af4578e80d626dc903a3cdece79.zip | |
Fixing autocompletion with 0 match, Fixing export singleton with --posix
Diffstat (limited to 'src/suite/suite.py')
| -rw-r--r-- | src/suite/suite.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/suite/suite.py b/src/suite/suite.py index b81205e..c482c64 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 02:14:58 by charles ### ########.fr # +# Updated: 2020/09/12 10:38:16 by charles ### ########.fr # # # # ############################################################################ # @@ -27,11 +27,10 @@ class Suite: @classmethod def setup(cls, asked_names: [str]): """Remove not asked suite from available suites""" - if len(asked_names) == 0: - asked_names = [s.name for s in cls.available] - if not config.BONUS: cls.available = [s for s in cls.available if not s.bonus] + if len(asked_names) == 0: + asked_names = [s.name for s in cls.available] names = [] for i, name in enumerate(asked_names): @@ -41,7 +40,7 @@ class Suite: or s.name.startswith(name)] if len(matches) == 1: names.append(matches[0]) - elif all([n.startswith(name) for n in matches]): + elif len(matches) != 0 and all([n.startswith(name) for n in matches]): names.extend(matches) elif len(matches) > 2: print(("Ambiguous name `{}` match the following suites\n\t{}\n" @@ -49,9 +48,9 @@ class Suite: .format(name, ', '.join(matches))) sys.exit(1) elif len(matches) == 0: - print(("No suite named `{}` found\n\t{}\n" + print(("Name `{}` doesn't match any suite/group name\n\t" "Try to run with -l to see the available suites") - .format(name, ', '.join(matches))) + .format(name)) sys.exit(1) cls.available = list(set( |
