From b2af12cc5c5148ba273a13924db778677adeaf1a Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Sun, 14 Mar 2010 08:32:56 +0000 Subject: [PATCH] ENHANCEMENT If no arguments specified for cli-script.php/sake, then provide a friendly message to the user on where to get help git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@100989 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- cli-script.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cli-script.php b/cli-script.php index 587401d07..43064d5a3 100755 --- a/cli-script.php +++ b/cli-script.php @@ -65,7 +65,12 @@ require_once("core/model/DB.php"); DB::connect($databaseConfig); // Get the request URL from the querystring arguments -$url = $_SERVER['argv'][1]; +$url = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : null; +if(!$url) { + echo 'Please specify an argument to cli-script.php/sake. For more information, visit http://doc.silverstripe.org/doku.php?id=sake'; + die(); +} + $_SERVER['REQUEST_URI'] = BASE_URL . '/' . $url; // Direct away - this is the "main" function, that hands control to the apporopriate controller