summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/freefeatures.rst13
-rw-r--r--docs/settingchanges.rst4
2 files changed, 15 insertions, 2 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
======================
diff --git a/docs/settingchanges.rst b/docs/settingchanges.rst
index f5ba16d4..539bbc9a 100644
--- a/docs/settingchanges.rst
+++ b/docs/settingchanges.rst
@@ -10,7 +10,7 @@ its name is included in the dictionary ``app.settable``.
Shortcuts
-===========================
+=========
Command shortcuts for long command names and common commands can make life more convenient for your users.
Shortcuts are used without a space separating them from their arguments, like ``!ls``. By default, the
@@ -48,7 +48,7 @@ To define more shortcuts, update the dict ``App.shortcuts`` with the
Aliases
-================
+=======
In addition to shortcuts, ``cmd2`` provides a full alias feature via the ``alias`` command which is similar to the
``alias`` command in Bash.