From 40722f10ace3107dcb4709008239ac8233ada30f Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Tue, 4 Feb 2020 23:01:30 -0500 Subject: Added cmd2.utils.Settable to the cmd2 namespace and updated examples and docs --- examples/remove_settable.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 examples/remove_settable.py (limited to 'examples/remove_settable.py') diff --git a/examples/remove_settable.py b/examples/remove_settable.py new file mode 100755 index 00000000..13a75e11 --- /dev/null +++ b/examples/remove_settable.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python +# coding=utf-8 +""" +A sample application for cmd2 demonstrating how to remove one of the built-in runtime settable parameters. +""" +import cmd2 + + +class MyApp(cmd2.Cmd): + + def __init__(self): + super().__init__() + self.settables.pop('debug') + + +if __name__ == '__main__': + import sys + c = MyApp() + sys.exit(c.cmdloop()) -- cgit v1.2.1