Skip to content

Commit 23b93e4

Browse files
committed
Avoid exception inside CLI, if input line is exactly: "\"
Fixes #146
1 parent f8e46c9 commit 23b93e4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

opensipscli/cli.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,8 @@ def complete(self, text, state):
355355
# Parse parameters
356356
def parse_command(self, line):
357357

358-
module = line[0]
358+
logger.debug("input line: '{}'".format(line))
359+
module = line[0] if line else None
359360
if len(line) < 2:
360361
return module, None, [], []
361362
paramIndex = 1
@@ -391,7 +392,11 @@ def run_command(self, module, cmd, modifiers, params):
391392
logger.error(err_msg)
392393
return -1
393394
else:
394-
logger.error("no module '{}' loaded".format(module))
395+
if module:
396+
logger.error("module '{}' is not available, type <Tab><Tab> to list all modules.".format(module))
397+
else:
398+
logger.error("no module specified! Type <Tab><Tab> to list all modules.")
399+
395400
return -1
396401
# if the module does not return any methods (returned None)
397402
# we simply call the module's name method

0 commit comments

Comments
 (0)