diff --git a/README.md b/README.md index f119ea9..cc43741 100644 --- a/README.md +++ b/README.md @@ -28,9 +28,7 @@ Usage Options - Highlight text, right click -> "Mark selection for comparison" - Mark a second selection, then right click -> "Compare selections" - Create two selections by holding CTRL, then "Compare selections" - - From the command line: - - Windows: ```subl --command "sbs_compare_files {\"A\":\"file1\", \"B\":\"file2\"}"``` - - Linux/OSX: ```subl --command 'sbs_compare_files {"A":"file1", "B":"file2"}'``` + - From the command line ([see README_COMMANDS.md](README_COMMANDS.md)) Configuration --- diff --git a/README_COMMANDS.md b/README_COMMANDS.md new file mode 100644 index 0000000..93d46fc --- /dev/null +++ b/README_COMMANDS.md @@ -0,0 +1,28 @@ +# Command Line Usage + +### Windows +```subl --command "sbs_compare_files {\"A\":\"file1\", \"B\":\"file2\"}"``` +Requires additional escaping of backslashes in file paths. + +**compare.bat** +_Usage: compare.bat file1.txt file2.txt_ +``` +set file1=%~1 +set file1=%file1:\=\\% +set file2=%~2 +set file2=%file2:\=\\% +subl --command "sbs_compare_files {\"A\":\"%file1%\", \"B\":\"%file2%\"}" +``` + +--- + +### Linux/OSX +```subl --command 'sbs_compare_files {"A":"file1", "B":"file2"}'``` +Untested on OSX, but should be the same as Linux. + +**compare.sh** +_Usage: compare.sh file1.txt file2.txt_ +``` +#!/bin/sh +eval subl3 --command \'sbs_compare_files {\"A\":\"$1\", \"B\":\"$2\"}\' +``` \ No newline at end of file