summaryrefslogtreecommitdiff
path: root/examples/remove_settable.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2020-02-04 23:01:30 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2020-02-04 23:01:30 -0500
commit40722f10ace3107dcb4709008239ac8233ada30f (patch)
tree676edd56ec5ba1287cd4f38b66f2733eea597ee9 /examples/remove_settable.py
parent61dfcf613966355d68c01f2aa06f0158b54c1f20 (diff)
downloadcmd2-git-40722f10ace3107dcb4709008239ac8233ada30f.tar.gz
Added cmd2.utils.Settable to the cmd2 namespace and updated examples and docs
Diffstat (limited to 'examples/remove_settable.py')
-rwxr-xr-xexamples/remove_settable.py19
1 files changed, 19 insertions, 0 deletions
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())