summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaromil <jaromil@dyne.org>2008-11-07 16:47:17 (GMT)
committer Jaromil <jaromil@dyne.org>2008-11-07 16:47:17 (GMT)
commit5e8071a1035825089d53e2fbe42809eeb6a03e4f (patch)
tree3b65fd21f88067765949b517230b10ca6f55f046
parent81d66cf71a7334dde544a7fa7e7ddb608f4255a5 (diff)
leaner commandline interface
-rw-r--r--cmdline.cpp36
-rw-r--r--tbt.143
2 files changed, 35 insertions, 44 deletions
diff --git a/cmdline.cpp b/cmdline.cpp
index 16578bd..ee8e005 100644
--- a/cmdline.cpp
+++ b/cmdline.cpp
@@ -66,22 +66,26 @@ TBT tbt;
void set_status(SLangWidget *s);
static const char *help =
-"Synopsis: tbt -(r|p) [options] [file]\n"
+"Synopsis: tbt <command> [options] [file]\n"
"Commands:\n"
" -r record\n"
" -p playback\n"
-"Options:\n"
+" -x convert\n"
+" -v print version\n"
" -h print this help\n"
-" -v version information\n"
-" -D debug verbosity level - default 1\n"
-" -c console interface mode (S-Lang)\n"
+"Options:\n"
+" -c console interface mode\n"
" -s save format in [ bin | ascii | html ]\n"
#ifdef linux
" -t timing mode [ posix | rtc ]\n"
#endif
-" -x convert tbt to [ bin | html | ascii]\n";
+" -D debug verbosity level (1-3)\n";
+
+
+
-static const char *short_options = "-hvD:crps:t:x:";
+
+static const char *short_options = "-hvD:crpxs:t:";
int debug;
char filename[512];
@@ -166,6 +170,10 @@ void cmdline(int argc, char **argv) {
operation = PLAY;
break;
+ case 'x':
+ operation = CONV;
+ break;
+
case 't':
if(strncasecmp(optarg, "rtc", 3) ==0)
timing = RTC;
@@ -187,20 +195,6 @@ void cmdline(int argc, char **argv) {
}
break;
- case 'x':
- operation = CONV;
- if( strcasecmp(optarg, "BIN") ==0)
- render = BIN;
- else if( strcasecmp(optarg, "ASCII") ==0)
- render = ASCII;
- else if( strcasecmp(optarg, "HTML") ==0)
- render = HTML;
- else {
- error ("render format not recognized: %s", optarg);
- act ("using default binary format render");
- render = BIN;
- }
- break;
case 1: snprintf(filename,511,"%s", optarg);
diff --git a/tbt.1 b/tbt.1
index 4ffb3a4..20f745a 100644
--- a/tbt.1
+++ b/tbt.1
@@ -60,13 +60,28 @@ The main functionalities are exclusive (use one or the other):
.B
.IP "-r"
-Record a Time Based Text
+Record a Time Based Text (use \f-s\fR to select format)
.B
.IP "-p"
Playback a Time Based Text
.B
-.IP "-x \fI<format_name>\fR"
-convert TBT file to format [ bin | html | ascii ]
+.IP "-x"
+Convert a Time Based Text (use \f-s\fR to select format)
+.B
+.IP "-v"
+Display version and quit
+.B
+.IP "-h"
+Display a help text and quit
+
+
+.SH OPTIONS
+
+The following switches are optional:
+
+.B
+.IP "-s \fI<format_name>\fR"
+save format in [ bin | ascii | html ]. Default is bin (see -x command)
The \fIbin\fR mode will store a binary file you can play with the
playtext command.
@@ -80,31 +95,13 @@ README.html file.
The \fIascii\fR mode produces pure ascii text file, one character per
line, with the information about the key pressed, and the timestamp.
-
.B
-.IP "-h"
-Display a help text and quit
-.B
-.IP "-v"
-Display version and quit
-
-
-.SH OPTIONS
-
-The following switches are optional:
+.IP "-c"
+Use the S-Lang console interface
.B
.IP "-D \fI<number>\fR"
Set verbosity level, the default value is 1
-.B
-.IP "-c"
-Use the S-Lang console interface
-.B
-.IP "-m"
-mail composer - option alias: recmail
-.B
-.IP "-s \fI<format_name>\fR"
-save format in [ bin | ascii | html ]. Default is bin (see -x command)
.B
.IP "-t \fI<timing mode>\fR"