blob: 828ebc066c41a636561d1d3a6bf0934448abcbff (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#!/usr/bin/env python
# coding=utf-8
"""A sample application demonstrating when commands are set to be case sensitive.
By default cmd2 parses commands in a case-insensitive manner. But this behavior can be changed.
"""
import cmd2
class CaseSensitiveApp(cmd2.Cmd):
""" Example cmd2 application where commands are case-sensitive."""
def __init__(self):
# Set this before calling the super class __init__()
self.case_insensitive = False
cmd2.Cmd.__init__(self)
self.debug = True
if __name__ == '__main__':
app = CaseSensitiveApp()
app.cmdloop()
|