changeset 987:d57fff79acc1

prepare: Fix a crash when preparing a new post.
author Ludovic Chabant <ludovic@chabant.com>
date Tue, 31 Oct 2017 09:33:36 -0700
parents ef224cce343c
children f83ae0a5d793
files piecrust/sources/posts.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/piecrust/sources/posts.py	Tue Oct 31 09:29:14 2017 -0700
+++ b/piecrust/sources/posts.py	Tue Oct 31 09:33:36 2017 -0700
@@ -154,8 +154,10 @@
 
     def setupPrepareParser(self, parser, app):
         parser.add_argument(
-            '-d', '--date', help="The date of the post, "
-            "in `year/month/day` format (defaults to today).")
+            '-d', '--date',
+            default='today',
+            help=("The date of the post, in `year/month/day` format "
+                  "(defaults to today)."))
         parser.add_argument('slug', help="The URL slug for the new post.")
 
     def createContent(self, args):