summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2018-03-17 00:08:35 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2018-03-17 00:08:35 -0400
commit763b1cb45fc12ec2570672ab787a4494b35a24fb (patch)
treee6cff0b0df8ce9bf84f3295a96d726e5ffc7aab3 /docs
parent3bf1c51b3218ffdd00c1369dac0160cab38b738a (diff)
downloadcmd2-git-763b1cb45fc12ec2570672ab787a4494b35a24fb.tar.gz
Added a tiny bit of documentation
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.