# HG changeset patch
# User catherine.devlin@gmail.com
# Date 1312145835 14400
# Node ID e4d6edca469b2b262b928439b0d105665ff89315
# Parent  f1ed2907ccab22887f2fe2043f7b75410503aeff
get history in script form

diff -r f1ed2907ccab -r e4d6edca469b cmd2.py
--- a/cmd2.py	Thu Jul 28 19:26:38 2011 -0400
+++ b/cmd2.py	Sun Jul 31 16:57:15 2011 -0400
@@ -1057,7 +1057,9 @@
                 pass
             keepstate.restore()
             
-    def do_history(self, arg):
+    @options([make_option('-s', '--script', action="store_true", help="Script format; no separation lines"),
+             ], arg_desc = '(limit on which commands to include)')
+    def do_history(self, arg, opts):
         """history [arg]: lists past commands issued
         
         | no arg:         list all
@@ -1070,7 +1072,10 @@
         else:
             history = self.history
         for hi in history:
-            self.stdout.write(hi.pr())
+            if opts.script:
+                self.poutput(hi)
+            else:
+                self.stdout.write(hi.pr())
     def last_matching(self, arg):
         try:
             if arg:
diff -r f1ed2907ccab -r e4d6edca469b docs/make.bat