summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2015-04-12 18:14:25 +0200
committermathieui <mathieui@mathieui.net>2015-04-12 18:14:25 +0200
commitabc3af1bac02ce690b7a18defefb4badfd73ac4a (patch)
treee4d1dd0d23f122817718636ccfe87c1a5c1bedc5 /src/core
parentee6c7d374a87df3479c081b3a4070c59e90ebf34 (diff)
downloadpoezio-abc3af1bac02ce690b7a18defefb4badfd73ac4a.tar.gz
poezio-abc3af1bac02ce690b7a18defefb4badfd73ac4a.tar.bz2
poezio-abc3af1bac02ce690b7a18defefb4badfd73ac4a.tar.xz
poezio-abc3af1bac02ce690b7a18defefb4badfd73ac4a.zip
Allow /set option=value
/set displays its results in the form “option=value”, so allowing the command to interpret the same format as a valid command is only logical (and allows quick copy/paste and edit).
Diffstat (limited to 'src/core')
-rw-r--r--src/core/commands.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/commands.py b/src/core/commands.py
index bf649161..6bd7bcb9 100644
--- a/src/core/commands.py
+++ b/src/core/commands.py
@@ -559,8 +559,10 @@ def command_set(self, args):
elif len(args) == 1:
option = args[0]
value = config.get(option)
+ if value is None and '=' in option:
+ args = option.split('=', 1)
info = ('%s=%s' % (option, value), 'Info')
- elif len(args) == 2:
+ if len(args) == 2:
if '|' in args[0]:
plugin_name, section = args[0].split('|')[:2]
if not section:
@@ -606,7 +608,7 @@ def command_set(self, args):
value = args[2]
info = config.set_and_save(option, value, section)
self.trigger_configuration_change(option, value)
- else:
+ elif len(args) > 3:
return self.command_help('set')
self.call_for_resize()
self.information(*info)