--- token/token.module	2008-11-08 00:44:23.000000000 -0600
+++ ./token.module	2008-12-14 22:27:12.000000000 -0600
@@ -12,6 +12,8 @@
  * @ingroup token
  */
 
+define('TOKEN_NUM_ARG_TOKENS', 4);  // set the number of [argX] and [argX-alias] tokens
+
 function token_theme() {
   return array(
     'token_help' => array(
@@ -86,6 +88,18 @@
       $values['site-mission'] = filter_xss_admin(variable_get('site_mission', ''));
       $values['site-mail']    = variable_get('site_mail', '');
       $values['site-date']    = format_date(time(), 'short', '', variable_get('date_default_timezone', 0));
+
+      for ($count=0; $count < TOKEN_NUM_ARG_TOKENS; ++$count ) {
+        $values['arg'. $count] = is_null($value = arg($count)) ? '' : $value;
+      }
+
+      $path = $_GET['q'];
+      $alias = drupal_get_path_alias($path);  // defaults to $path if no alias is found
+
+      for ($count=0; $count < TOKEN_NUM_ARG_TOKENS; ++$count ) {
+        $values['arg'. $count .'-alias'] = is_null($value = arg($count, $alias)) ? '' : $value;
+      }
+
       break;
   }
   return $values;
@@ -115,6 +129,12 @@
   $tokens['global']['site-mission'] = t('The mission of the current Drupal website.');
   $tokens['global']['site-mail']    = t('The contact email address for the current Drupal website.');
   $tokens['global']['site-date']    = t("The current date on the site's server.");
+
+  for ($count=0; $count < TOKEN_NUM_ARG_TOKENS; ++$count ) {
+    $tokens['global']['arg'. $count]           = t('Url argument %component.', array('%component' => $count));
+    $tokens['global']['arg'. $count .'-alias'] = t('Url alias argument %component - defaults to url if no alias is found.', array('%component' => $count));
+  }
+
   return $tokens;
 }
 

