Skip to content
Snippets Groups Projects
Commit bc75a486 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Allow a left or right margin to be specified with -m option

default: 0 (no margin)
parent 7a03c138
No related branches found
No related tags found
No related merge requests found
...@@ -20,7 +20,8 @@ function usage() { ...@@ -20,7 +20,8 @@ function usage() {
writeln(""); writeln("");
writeln(" -f [font] Specify font file used."); writeln(" -f [font] Specify font file used.");
writeln(" -j l|r|c Justify left, right, or center. Default is left."); writeln(" -j l|r|c Justify left, right, or center. Default is left.");
writeln(" -w n Set screen width. Default is 80."); writeln(" -w n Set screen width. Default is auto-detect or 80.");
wrintln(" -m n Set margin/offset (for left or right justification).");
writeln(" -a Color sequences: ANSI. Default is Synchronet Ctrl-A."); writeln(" -a Color sequences: ANSI. Default is Synchronet Ctrl-A.");
writeln(" -u Encode charaters as UTF-8. Default is CP437."); writeln(" -u Encode charaters as UTF-8. Default is CP437.");
writeln(" -x n Index to font within file. Default is 0."); writeln(" -x n Index to font within file. Default is 0.");
...@@ -63,6 +64,9 @@ for(i = 0; i < argv.length; ++i) { ...@@ -63,6 +64,9 @@ for(i = 0; i < argv.length; ++i) {
exit(1); exit(1);
} }
++i; ++i;
} else if (arg === "-m" && i + 1 < argv.length) {
tdf.opt.margin = parseInt(argv[i + 1], 10);
++i;
} else if (arg === "-w" && i + 1 < argv.length) { } else if (arg === "-w" && i + 1 < argv.length) {
tdf.opt.width = parseInt(argv[i + 1], 10); tdf.opt.width = parseInt(argv[i + 1], 10);
++i; ++i;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment