[[[
Updated standalone diff to the newest diff API.

 * tools/diff/diff.c: Updated the standalone diff tool so that it
   can  handle diff options.
]]]
Index: tools/diff/diff.c
===================================================================
--- tools/diff/diff.c	(revisión: 24496)
+++ tools/diff/diff.c	(copia de trabajo)
@@ -29,11 +29,12 @@
 do_diff(svn_stream_t *ostream,
         const char *original, const char *modified,
         svn_boolean_t *has_changes,
+        svn_diff_file_options_t *options,
         apr_pool_t *pool)
 {
   svn_diff_t *diff;
 
-  SVN_ERR(svn_diff_file_diff(&diff, original, modified, pool));
+  SVN_ERR(svn_diff_file_diff_2(&diff, original, modified, options, pool));
 
   *has_changes = svn_diff_contains_diffs(diff);
 
@@ -44,14 +45,30 @@
   return NULL;
 }
 
+void
+print_usage(svn_stream_t *ostream, const char *progname,
+                 apr_pool_t *pool)
+{
+  svn_error_clear(svn_stream_printf(ostream, pool,
+                                    "Usage: %s <file1> <file2>\n",
+                                    progname));
+}
+
 int main(int argc, char *argv[])
 {
   apr_pool_t *pool;
   svn_stream_t *ostream;
-  int rc;
   svn_error_t *svn_err;
+  svn_boolean_t has_changes;
+  svn_diff_file_options_t *diff_options;
+  apr_array_header_t *options_array;
+  int i;
+  const char *from = NULL;
+  const char *to = NULL;
+  svn_boolean_t no_more_options = FALSE;
 
   apr_initialize();
+  atexit(apr_terminate);
 
   pool = svn_pool_create(NULL);
 
@@ -59,32 +76,58 @@
   if (svn_err)
     {
       svn_handle_error2(svn_err, stdout, FALSE, "diff-test: ");
-      rc = 2;
+      return 2;
     }
-  else if (argc == 3)
+  
+  options_array = apr_array_make(pool, 0, sizeof(char*));
+  
+  for ( i = 1 ; i < argc ; i++ )
     {
-      svn_boolean_t has_changes;
-
-      svn_err = do_diff(ostream, argv[1], argv[2], &has_changes, pool);
-      if (svn_err == NULL)
+      if (!no_more_options && (argv[i][0] == '-'))
         {
-          rc = has_changes ? 1 : 0;
+          if (argv[i][1] == '-' && !argv[i][2])
+            {
+              no_more_options = TRUE;
+              continue;
+            }
+          *((char**)apr_array_push(options_array)) = argv[i];
         }
       else
         {
-          svn_handle_error2(svn_err, stdout, FALSE, "diff-test: ");
-          rc = 2;
+          if (from == NULL)
+            from = argv[i];
+          else if (to == NULL)
+            to = argv[i];
+          else
+            {
+              print_usage(ostream, argv[0], pool);
+              return 2;
+            }
         }
     }
-  else
+
+  if (!from || !to)
     {
-      svn_error_clear(svn_stream_printf(ostream, pool,
-                                        "Usage: %s <file1> <file2>\n",
-                                        argv[0]));
-      rc = 2;
+      print_usage(ostream, argv[0], pool);
+      return 2;
     }
 
-  apr_terminate();
+  diff_options = svn_diff_file_options_create(pool);
 
-  return rc;
+  svn_err = svn_diff_file_options_parse(diff_options, options_array, pool);
+  if (svn_err)
+    {
+      svn_handle_error2(svn_err, stdout, FALSE, "diff-test: ");
+      return 2;
+    }
+
+  svn_err = do_diff(ostream, from, to, &has_changes,
+                    diff_options, pool);
+  if (svn_err)
+    {
+      svn_handle_error2(svn_err, stdout, FALSE, "diff-test: ");
+      return 2;
+    }
+
+  return has_changes ? 1 : 0;
 }


