summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2014-01-30 17:27:37 +0000
committerNick White <git@njw.me.uk>2014-01-30 17:27:37 +0000
commit170cc4b91cf6f7d6266363bd73ec55a3db9b60ff (patch)
treefc0358be0f27be7900c5ee1793c7d3bba29a0f17
parentc4f4d63fbec5dbb026e9ccebbc89e498f3c42e1c (diff)
downloadtkread-170cc4b91cf6f7d6266363bd73ec55a3db9b60ff.tar.bz2
tkread-170cc4b91cf6f7d6266363bd73ec55a3db9b60ff.zip
Add usage printing
-rwxr-xr-xtkread14
1 files changed, 10 insertions, 4 deletions
diff --git a/tkread b/tkread
index 49c68b4..d078bcd 100755
--- a/tkread
+++ b/tkread
@@ -1,9 +1,10 @@
#!/usr/bin/tclsh
# See COPYING file for copyright and license details.
-# Usage: tkread [-w] [-m]
-# -w rewrap lines
-# -m format markdown text
-#
+
+set usage {tkread [-w] [-m]
+ -w rewrap lines
+ -m format markdown text}
+
# The markdown parsing is inspired by the code of smu:
# <https://github.com/Gottox/smu>
#
@@ -38,6 +39,11 @@ set surroundfmt { \
{"=" "6" ""} \
}
+if { $::argc > 0 && [lindex $::argv 0] == "-h" } {
+ puts "Usage: $usage"
+ exit
+}
+
package require Tk
proc rewrap {text} {