Skip to content

Commit ffd1b0d

Browse files
committed
#47 Added +N option as alias for --line
1 parent 438ed0a commit ffd1b0d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Read text from stdin
5858
-p, --port PORT Port number to use for connection.
5959
-w, --[no-]wait Wait for file to be closed by TextMate.
6060
-l, --line LINE Place caret on line number after loading file.
61+
+N Alias for --line, if N is a number (eg.: +5).
6162
-m, --name NAME The display name shown in TextMate.
6263
-t, --type TYPE Treat file as having specified type.
6364
-n, --new Open in a new window (Sublime Text).
@@ -99,7 +100,7 @@ any damage the software may cause to your system or files.
99100

100101
rmate
101102

102-
Copyright (C) 2011-2015 by Harald Lapp <[email protected]>
103+
Copyright (C) 2011-2016 by Harald Lapp <[email protected]>
103104

104105
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 the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
105106

rmate

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
# rmate
4-
# Copyright (C) 2011-2015 by Harald Lapp <[email protected]>
4+
# Copyright (C) 2011-2016 by Harald Lapp <[email protected]>
55
#
66
# This program is free software: you can redistribute it and/or modify
77
# it under the terms of the GNU General Public License as published by
@@ -104,6 +104,7 @@ function showusage {
104104
-p, --port PORT Port number to use for connection. Defaults to $port.
105105
-w, --[no-]wait Wait for file to be closed by TextMate.
106106
-l, --line LINE Place caret on line number after loading file.
107+
+N Alias for --line, if N is a number (eg.: +5).
107108
-m, --name NAME The display name shown in TextMate.
108109
-t, --type TYPE Treat file as having specified type.
109110
-n, --new Open in a new window (Sublime Text).
@@ -141,7 +142,7 @@ function canonicalize {
141142
echo $result
142143
}
143144

144-
while test "${1:0:1}" = "-"; do
145+
while [[ "${1:0:1}" = "-" || "$1" =~ ^\+([0-9]+)$ ]]; do
145146
case $1 in
146147
-)
147148
break
@@ -189,6 +190,9 @@ while test "${1:0:1}" = "-"; do
189190
showusage
190191
exit 1
191192
;;
193+
+[0-9]*)
194+
selection=${1:1}
195+
;;
192196
*)
193197
showusage
194198
exit 1

0 commit comments

Comments
 (0)