aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--oni-ediff.el10
1 files changed, 9 insertions, 1 deletions
diff --git a/oni-ediff.el b/oni-ediff.el
index f8917de..6d87d27 100644
--- a/oni-ediff.el
+++ b/oni-ediff.el
@@ -4,7 +4,7 @@
;; Author: Tom Willemse <tom@ryuslash.org>
;; Keywords: local
-;; Version: 2019.0904.210509
+;; Version: 2019.1010.164050
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
@@ -39,6 +39,14 @@
'(fullscreen fullboth))
(set-frame-parameter nil 'fullscreen nil)))
+;;;###autoload
+(defun oni-ediff-from-command-line ()
+ "Call ‘ediff’ with arguments from the command line."
+ (pcase command-line-args-left
+ (`(,fileA ,fileB) (ediff-files fileA fileB))
+ (`(,fileA ,fileB ,fileC) (ediff-files3 fileA fileB fileC))
+ (_ (error "Invalid number of arguments, need either 2 or 3 files"))))
+
(setq ediff-window-setup-function 'ediff-setup-windows-plain)
(setq ediff-split-window-function 'split-window-horizontally)