@@ -182,10 +182,12 @@ int main(string[] args)
182182
183183 if (optSocketWebServer ! is null )
184184 {
185+ // dfmt off
185186 stdout.writeln();
186187 stdout.writeln(" Built-in webserver: " , webserver.toString);
187188 stdout.writeln(" Serving: " , optDocumentRootWebServer.absolutePath);
188189 stdout.writeln(" Script injection: " , ((optNoInjectWebServer) ? " disabled" : " enabled" ));
190+ // dfmt on
189191 }
190192
191193 stdout.writeln();
@@ -200,11 +202,32 @@ int main(string[] args)
200202
201203void printHelp (string args0, GetoptResult opt)
202204{
203- defaultGetoptPrinter(appName ~ " \n\n Usage:\n " ~ args0
204- ~ " <options>\n\n Example:\n " ~ args0 ~ " --socket=127.0.0.1:3001"
205- ~ " \n --watch=./src --watch=./sass"
206- ~ " \n --action=\" npm run build\" --action=\" ./refreshDB.sh\" "
207- ~ " \n\n Available options:\n ==================" , opt.options);
205+ // Ideally, this help text will not exceed a size of
206+ // 80x23, so that it's fully visible on an 80x24 terminal.
207+
208+ size_t getIndent ()
209+ {
210+ immutable l = args0.length + 5 ;
211+ return (l <= 29 ) ? l : 8 ;
212+ }
213+
214+ string makeIndent ()
215+ {
216+ enum indent = " " ;
217+ return indent[0 .. getIndent()];
218+ }
219+
220+ immutable indent = makeIndent();
221+
222+ // dfmt off
223+ defaultGetoptPrinter(
224+ appName ~ " \n\n Usage:\n " ~ args0 ~ " <options>\n\n Example:\n "
225+ ~ args0 ~ " --socket=127.0.0.1:3001\n "
226+ ~ indent ~ " --watch=./src --watch=./sass\n "
227+ ~ indent ~ " --action=\" npm run build\" --action=\" ./refreshDB.sh\" "
228+ ~ " \n\n Available options:\n ==================" ,
229+ opt.options
230+ );
208231}
209232
210233void printVersionInfo ()
0 commit comments