Skip to content

Commit

Permalink
Added separate readme for commandline usage & examples
Browse files Browse the repository at this point in the history
  • Loading branch information
DougTy committed Sep 30, 2015
1 parent 4bc21f2 commit 9686619
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
---
Expand Down
28 changes: 28 additions & 0 deletions README_COMMANDS.md
Original file line number Diff line number Diff line change
@@ -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\"}\'
```

0 comments on commit 9686619

Please sign in to comment.