Skip to content

Commit

Permalink
Update on #628: make sure subcommands cannot define settings - only r…
Browse files Browse the repository at this point in the history
…oot commands can
  • Loading branch information
hugsy committed Apr 9, 2021
1 parent d554c4a commit 3b7a97c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -4190,6 +4190,9 @@ def has_setting(self, name):
return key in __config__

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

0 comments on commit 3b7a97c

Please sign in to comment.