summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xREADME.md2
-rw-r--r--docs/freefeatures.rst13
-rw-r--r--docs/settingchanges.rst4
3 files changed, 16 insertions, 3 deletions
diff --git a/README.md b/README.md
index ab57f823..8a93804d 100755
--- a/README.md
+++ b/README.md
@@ -29,7 +29,7 @@ Main Features
- Option to display long output using a pager with ``cmd2.Cmd.ppaged()``
- Multi-line commands
- Special-character command shortcuts (beyond cmd's `@` and `!`)
-- Command aliasing
+- Command aliasing and loading a commands at startup from an initialization script
- Settable environment parameters
- Parsing commands with arguments using `argparse`, including support for sub-commands
- Sub-menu support via the ``AddSubmenu`` decorator
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.