diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-03-17 00:08:35 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-03-17 00:08:35 -0400 |
commit | 763b1cb45fc12ec2570672ab787a4494b35a24fb (patch) | |
tree | e6cff0b0df8ce9bf84f3295a96d726e5ffc7aab3 /docs/freefeatures.rst | |
parent | 3bf1c51b3218ffdd00c1369dac0160cab38b738a (diff) | |
download | cmd2-git-763b1cb45fc12ec2570672ab787a4494b35a24fb.tar.gz |
Added a tiny bit of documentation
Diffstat (limited to 'docs/freefeatures.rst')
-rw-r--r-- | docs/freefeatures.rst | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/freefeatures.rst b/docs/freefeatures.rst index dff82de4..a27ee453 100644 --- a/docs/freefeatures.rst +++ b/docs/freefeatures.rst @@ -52,6 +52,19 @@ be pointless within an interactive session. .. _pyparsing: http://pyparsing.wikispaces.com/ .. _arg_print: https://github.com/python-cmd2/cmd2/blob/master/examples/arg_print.py +Startup Initialization Script +============================= +You can load and execute commands from a startup initialization script by passing a file path to the ``startup_script`` +argument to the ``cmd.Cmd.__init__()`` method like so:: + + class AliasAndStartup(cmd2.Cmd): + def __init__(self): + cmd2.Cmd.__init__(self, startup_script='.cmd2rc') + +See the AliasStartup_ example for a demonstration. + +.. _AliasStartup: https://github.com/python-cmd2/cmd2/blob/master/examples/alias_startup.py + Commands at invocation ====================== |