diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-07-30 23:52:00 -0700 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-07-30 23:52:00 -0700 |
commit | 57e6bf0c0162c3fd445580344ada5d662b373bd3 (patch) | |
tree | 5ba022bfcc13ca1d6f9f16ac323d570cde51895b /examples/alias_startup.py | |
parent | 38c23a83dabebe5b4052ac3694cbffac4f95ac34 (diff) | |
download | cmd2-git-57e6bf0c0162c3fd445580344ada5d662b373bd3.tar.gz |
Fix Sphinx warning due to _static directory
Also:
- Made alias_startup.py example robust as to what directory it is launched from
Diffstat (limited to 'examples/alias_startup.py')
-rwxr-xr-x | examples/alias_startup.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/alias_startup.py b/examples/alias_startup.py index 4a061e87..4ae91661 100755 --- a/examples/alias_startup.py +++ b/examples/alias_startup.py @@ -4,14 +4,15 @@ 1) How to add custom command aliases using the alias command 2) How to load an initialization script at startup """ - +import os import cmd2 class AliasAndStartup(cmd2.Cmd): """ Example cmd2 application where we create commands that just print the arguments they are called with.""" def __init__(self): - super().__init__(startup_script='.cmd2rc') + alias_script = os.path.join(os.path.dirname(__file__), '.cmd2rc') + super().__init__(startup_script=alias_script) if __name__ == '__main__': |