Skip to content

Commit 3b7a97c

Browse files
author
hugsy
committed
Update on #628: make sure subcommands cannot define settings - only root commands can
1 parent d554c4a commit 3b7a97c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Diff for: gef.py

+3
Original file line numberDiff line numberDiff line change
@@ -4190,6 +4190,9 @@ def has_setting(self, name):
41904190
return key in __config__
41914191

41924192
def add_setting(self, name, value, description=""):
4193+
# make sure settings are always associated to the root command (which derives from GenericCommand)
4194+
if "GenericCommand" not in [x.__name__ for x in self.__class__.__bases__]:
4195+
return
41934196
key = self.__get_setting_name(name)
41944197
__config__[key] = [value, type(value), description]
41954198
get_gef_setting.cache_clear()

0 commit comments

Comments
 (0)