Added support for calling controllers, methods and passing parameters via command line, either automatically or specifically with $config['uri_protocol'] = 'CLI';
diff --git a/system/core/URI.php b/system/core/URI.php
index 047e3c9..479a225 100644
--- a/system/core/URI.php
+++ b/system/core/URI.php
@@ -68,6 +68,13 @@
 				return;
 			}
 
+			// Arguments exist, it must be a command line request
+			if ( ! empty($_SERVER['argv']))
+			{
+				$this->uri_string = $this->_parse_cli_args();
+				return;
+			}
+
 			// Is there a PATH_INFO variable?
 			// Note: some servers seem to have trouble with getenv() so we'll test it two ways
 			$path = (isset($_SERVER['PATH_INFO'])) ? $_SERVER['PATH_INFO'] : @getenv('PATH_INFO');
@@ -104,6 +111,11 @@
 				$this->uri_string = $this->_parse_request_uri($this->_get_request_uri());
 				return;
 			}
+			elseif ($uri == 'CLI')
+			{
+				$this->uri_string = $this->_parse_cli_args();
+				return;
+			}
 
 			$this->uri_string = (isset($_SERVER[$uri])) ? $_SERVER[$uri] : @getenv($uri);
 		}
@@ -144,7 +156,7 @@
 		{
 			$uri = $_SERVER['HTTP_X_REWRITE_URL'];
 		}
-		
+
 		// Last ditch effort (for older CGI servers, like IIS 5)
 		elseif (isset($_SERVER['ORIG_PATH_INFO']))
 		{
@@ -171,7 +183,7 @@
 	 * @param	string
 	 * @return	string
 	 */
-	function _parse_request_uri($uri)
+	private function _parse_request_uri($uri)
 	{
 		// Some server's require URL's like index.php?/whatever If that is the case,
 		// then we need to add that to our parsing.
@@ -216,6 +228,23 @@
 	// --------------------------------------------------------------------
 
 	/**
+	 * Parse cli arguments
+	 *
+	 * Take each command line argument and assume it is a URI segment.
+	 *
+	 * @access	private
+	 * @return	string
+	 */
+	private function _parse_cli_args()
+	{
+		$args = array_slice($_SERVER['argv'], 1);
+
+		return $args ? '/' . implode('/', $args) : '';
+	}
+
+	// --------------------------------------------------------------------
+
+	/**
 	 * Filter segments for malicious characters
 	 *
 	 * @access	private
@@ -524,7 +553,7 @@
 	{
 		$leading	= '/';
 		$trailing	= '/';
-		
+
 		if ($where == 'trailing')
 		{
 			$leading	= '';
@@ -533,7 +562,7 @@
 		{
 			$trailing	= '';
 		}
-		
+
 		return $leading.$this->$which($n).$trailing;
 	}