summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNat Lasseter <Nat Lasseter nathan@bytemark.co.uk>2017-11-09 13:19:30 +0000
committerNat Lasseter <Nat Lasseter nathan@bytemark.co.uk>2017-11-09 13:19:30 +0000
commit5172284553ce4ef603793dcda95d8a91e3e8a67d (patch)
tree0b191329ebe602fae0e0f629a95d1e5201cad612
parentdb16d3b53473a690726a4a42fd957e4f9e9293a5 (diff)
equote: can now call equote [length [quotechar]]
-rwxr-xr-xequote5
1 files changed, 3 insertions, 2 deletions
diff --git a/equote b/equote
index 3aadaed..3fb5a85 100755
--- a/equote
+++ b/equote
@@ -1,6 +1,7 @@
#!/usr/bin/env ruby
-LINELENGTH = (ARGV.shift || 72).to_i
+LINELENGTH = (ARGV.shift.chomp || 72).to_i
+CHAR = ARGV.shift.chomp || ">"
lines = $stdin.readlines
@@ -25,7 +26,7 @@ lines = lines.map { |line|
lines = lines.flatten
lines = lines.map { |line|
- "> #{line}"
+ "#{CHAR} #{line}"
}
puts lines