summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorcat <cat@eee>2010-02-12 22:15:04 -0500
committercat <cat@eee>2010-02-12 22:15:04 -0500
commit0d43627fd68908aa83bda63506b755f308dd38a5 (patch)
treeb14e6ceb9e5a73518990e4018391b7a383ebf52b /docs
parent00e5dc290b3e9605ef96e7973fe7881daf56dc7c (diff)
downloadcmd2-hg-0d43627fd68908aa83bda63506b755f308dd38a5.tar.gz
doc refreshing refresh.bash
Diffstat (limited to 'docs')
-rw-r--r--docs/freefeatures.rst16
-rw-r--r--docs/index.rst5
-rwxr-xr-xdocs/refresh.bash7
-rw-r--r--docs/unfreefeatures.rst23
4 files changed, 51 insertions, 0 deletions
diff --git a/docs/freefeatures.rst b/docs/freefeatures.rst
index 1f76f28..93be325 100644
--- a/docs/freefeatures.rst
+++ b/docs/freefeatures.rst
@@ -152,5 +152,21 @@ mental imbalance.
(Cmd) speak it was /* not */ delicious! # Yuck!
it was delicious!
+Misc. pre-defined commands
+==========================
+
+Several generically useful commands are defined
+with automatically included ``do_`` methods.
+
+.. automethod:: cmd2.Cmd.do_quit
+
+.. automethod:: cmd2.Cmd.do_pause
+
+.. automethod:: cmd2.Cmd.do_shell
+
+( ``!`` is a shortcut for ``shell``; thus ``!ls``
+is equivalent to ``shell ls``.)
+
+
Transcript-based testing
========================
diff --git a/docs/index.rst b/docs/index.rst
index a348bb4..cc771e5 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -20,6 +20,11 @@ The basic use of ``cmd2`` is identical to that of cmd_.
app = App()
app.cmdloop()
+
+These docs will refer to ``App`` as your ``cmd2.Cmd``
+subclass, and ``app`` as an instance of ``App``. Of
+course, in your program, you may name them whatever
+you want.
Contents:
diff --git a/docs/refresh.bash b/docs/refresh.bash
new file mode 100755
index 0000000..fdea359
--- /dev/null
+++ b/docs/refresh.bash
@@ -0,0 +1,7 @@
+make html
+#scp -r build catherine@$tummy:/var/www/sqlpython
+cd _build
+zip -r cmd2_docs *
+mv cmd2_docs.zip ..
+cd ..
+echo "Upload cmd2_docs.zip to http://pypi.python.org/pypi/cmd2"
diff --git a/docs/unfreefeatures.rst b/docs/unfreefeatures.rst
index 20193c5..e341fc3 100644
--- a/docs/unfreefeatures.rst
+++ b/docs/unfreefeatures.rst
@@ -189,3 +189,26 @@ useful for non-essential feedback that the user may not always want
to read. ``quiet`` is only relevant if
``app.pfeedback`` is sometimes used.
+``select``
+==========
+
+``app.select`` is called from within a method (not by the user directly; it is ``app.select``, not ``app.do_select``).
+
+.. automethod:: cmd2.Cmd.select
+
+::
+
+ def do_eat(self, arg):
+ sauce = self.select('sweet salty', 'Sauce? ')
+ result = '{food} with {sauce} sauce, yum!'
+ result = result.format(food=arg, sauce=sauce)
+ self.stdout.write(result + '\n')
+
+::
+
+ (Cmd) eat wheaties
+ 1. sweet
+ 2. salty
+ Sauce? 2
+ wheaties with salty sauce, yum!
+