From 2237dd48560beaa17ca504e66dd95b2274b18b70 Mon Sep 17 00:00:00 2001 From: Ronny Abraham Date: Thu, 9 Nov 2017 00:33:30 +0200 Subject: [PATCH] added help message for django.startapp --- modules/django.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/modules/django.py b/modules/django.py index 3a08ebd..b9cc655 100644 --- a/modules/django.py +++ b/modules/django.py @@ -129,23 +129,35 @@ def run(args=None): @task -def startapp(args): +def startapp(appname='help'): """ wrapper for the django.startapp takes name of app and creates in in code/apps - args - name of app + appname - name of app """ configuration = env.config - destination = os.path.join(configuration.paths.django.apps, args) + msg_help = """ + django.startapp takes one of two values: + \thelp - this help message + \tappname - the name of the app you want to start + """ + + from utils import handle_help + import sys + + if handle_help(appname, msg_help, 'help'): + sys.exit() + + destination = os.path.join(configuration.paths.django.apps, appname) cmd_mkdir = "mkdir {destination}".format( destination=destination) command = "startapp {appname} {destination}".format( - appname=args, + appname=appname, destination=destination) fabric_ops.run(cmd_mkdir)