From 2f45f48208988a77580ffc5cc57ba98e11fdc630 Mon Sep 17 00:00:00 2001
From: Kyle Mathews <mathews.kyle@gmail.com>
Date: Fri, 13 May 2011 16:32:35 -0700
Subject: [PATCH] Initial checkin of the new drush command.

---
 path_redirect.drush.inc |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)
 create mode 100644 path_redirect.drush.inc

diff --git a/path_redirect.drush.inc b/path_redirect.drush.inc
new file mode 100644
index 0000000..6cb5d47
--- /dev/null
+++ b/path_redirect.drush.inc
@@ -0,0 +1,39 @@
+<?php
+
+/*
+ * Implementation of hook_drush_command().
+ */
+function path_redirect_drush_command() {
+  $items = array();
+  $items['path-redirect-save'] = array(
+    'callback' => 'path_redirect_drush_save',
+    'description' => dt('Save a new path redirect'),
+    'arguments' => array(
+      'source' => dt('string for source URL'),
+      'redirect' => dt('string for redirect URL'),
+    ),
+    'bootstrap' => DRUSH_BOOTSTRAP_MAX,
+  );
+
+  return $items;
+}
+
+/*
+ * Save a new path redirect.
+ */
+function path_redirect_drush_save($source, $redirect) {
+  $redirect = array(
+    'source' => $source,
+    'redirect' => $redirect,
+  );
+
+  path_redirect_save($redirect);
+
+  if (!empty($redirect['rid'])) {
+    drush_print("The new redirect was saved successfully.");
+  }
+  else {
+    drush_print("The new redirect was not saved due to an unknown error.");
+  }
+}
+
-- 
1.7.4.1

