aboutsummaryrefslogtreecommitdiff
path: root/listamsb.c
diff options
context:
space:
mode:
Diffstat (limited to 'listamsb.c')
-rw-r--r--listamsb.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/listamsb.c b/listamsb.c
index 52d7bc7..182f928 100644
--- a/listamsb.c
+++ b/listamsb.c
@@ -80,6 +80,7 @@ int check_only = 0; /* -c */
int startline = 0; /* -r */
int endline = 65536; /* -r */
int unlock_mode = 0; /* -l */
+int initial_eol = 1; /* -n */
int locked = 0;
int need_pclose = 0;
@@ -305,7 +306,7 @@ int next_line(void) {
}
/* AMSB always prints a blank line when it LISTs, so we do too. */
- if(last_lineno == -1) fputc(EOL, outfile);
+ if(initial_eol && (last_lineno == -1)) fputc(EOL, outfile);
last_lineno = lineno;
@@ -451,10 +452,11 @@ void unlock_program(void) {
void print_help(void) {
printf("%s v" VERSION " - detokenize Atari Microsoft BASIC files\n", self);
puts("By B. Watson <urchlay@slackware.uk>, released under the WTFPL");
- printf("Usage: %s [[-l] | [-a] [-v] [-h] [-i] [-u] [-t] [-m] [-s] [-r *start,end*]] [file]\n", self);
+ printf("Usage: %s [[-l] | [-a] [-v] [-h] [-i] [-n] [-u] [-t] [-m] [-s] [-r *start,end*]] [file]\n", self);
puts(" -a: raw ATASCII output");
puts(" -c: check only (no listing)");
puts(" -l: lock or unlock program");
+ puts(" -n: no blank line at start of listing");
puts(" -v: verbosity");
puts(" -r: only list lines numbered from *start* to *end*");
puts(" --help, -h: print this help and exit");
@@ -512,12 +514,13 @@ void parse_args(int argc, char **argv) {
}
}
- while( (opt = getopt(argc, argv, "lr:cvaiutmsh")) != -1) {
+ while( (opt = getopt(argc, argv, "nlr:cvaiutmsh")) != -1) {
switch(opt) {
case 'l': unlock_mode = 1; break;
case 'c': check_only = 1; break;
case 'a': raw_output = 1; break;
case 'v': verbosity++ ; break;
+ case 'n': initial_eol = 0; break;
case 'h': print_help(); exit(0);
case 'r': get_line_range(optarg); break;
case 'i':