stephen322/dircmp — pull request #2 by quickfur (2014-10-07 17:04:02+00:00)
Title: Nicer error messages from getopt.

Displaying stack traces for user errors, like specifying the wrong option, is kinda silly. Just show a nice error message and leave it at that.

Before:
````
object.Exception@/mnt/1/usr/include/d/4.9/std/getopt.d(427): Unrecognized option -asdf
----------------
0x4a5793 @safe void std.getopt.getoptImpl!().getoptImpl(ref immutable(char)[][], ref std.getopt.configuration)
???:0
0x4a547b void std.getopt.getoptImpl!(std.getopt.config).getoptImpl(ref immutable(char)[][], ref std.getopt.configuration, std.getopt.config)
???:0
0x4a5435 void std.getopt.getoptImpl!(immutable(char)[], bool*, std.getopt.config).getoptImpl(ref immutable(char)[][], ref std.getopt.configuration, immutable(char)[], bool*, std.getopt.config)
???:0
0x4a52a3 void std.getopt.getoptImpl!(immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, std.getopt.config).getoptImpl(ref immutable(char)[][], ref std.getopt.configuration, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, std.getopt.config)
???:0
0x4a50fa void std.getopt.getoptImpl!(immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, std.getopt.config).getoptImpl(ref immutable(char)[][], ref std.getopt.configuration, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, std.getopt.config)
???:0
0x4a4f49 void std.getopt.getoptImpl!(immutable(char)[], bool*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, std.getopt.config).getoptImpl(ref immutable(char)[][], ref std.getopt.configuration, immutable(char)[], bool*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, std.getopt.config)
???:0
0x4a4d93 void std.getopt.getoptImpl!(immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, std.getopt.config).getoptImpl(ref immutable(char)[][], ref std.getopt.configuration, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, std.getopt.config)
???:0
0x4a4bd0 std.getopt.getoptImpl!(immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, std.getopt.config).getoptImpl(ref immutable(char)[][], ref std.getopt.configuration, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*,
0x4a4a05 std.getopt.getoptImpl!(immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, std.getopt.config).getoptImpl(ref immutable(char)[][], ref std.getopt.configuration, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*,
0x4a4821 std.getopt.getoptImpl!(immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, std.getopt.config).getoptImpl(ref immutable(char)[][], ref std.getopt.configuration, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[]
0x4a3b6c std.getopt.getoptImpl!(immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, std.getopt.config).getoptImpl(ref immutable(char)[][], ref std.getopt.configuration, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[]*,
0x4a3964 std.getopt.getoptImpl!(immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, std.getopt.config).getoptImpl(ref immutable(char)[][], ref std.getopt.configuration, immutable(char)[], bool*, immutable(char)[],
0x4a2b40 std.getopt.getoptImpl!(immutable(char)[], uint*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, std.getopt.config).getoptImpl(ref immutable(char)[][], ref std.getopt.configuration, immutable(char)[], uint*,
0x4a1a41 std.getopt.getoptImpl!(immutable(char)[], dircmp.probables*, immutable(char)[], uint*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, std.getopt.config).getoptImpl(ref immutable(char)[][], ref std.getopt.
0x4a1807 std.getopt.getoptImpl!(immutable(char)[], bool*, immutable(char)[], dircmp.probables*, immutable(char)[], uint*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, std.getopt.config).getoptImpl(ref immutable(
0x4a15b7 std.getopt.getoptImpl!(immutable(char)[], immutable(char)[][]*, immutable(char)[], bool*, immutable(char)[], dircmp.probables*, immutable(char)[], uint*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, std.
0x4a1359 std.getopt.getoptImpl!(immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], bool*, immutable(char)[], dircmp.probables*, immutable(char)[], uint*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, immutable(char)[], bool*, immutable(char)[], immutable(
0x4a10e5 std.getopt.getoptImpl!(immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], bool*, immutable(char)[], dircmp.probables*, immutable(char)[], uint*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[]*, immutable(char)[], bool*, immutable(char)
0x4a0e63 std.getopt.getoptImpl!(immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], bool*, immutable(char)[], dircmp.probables*, immutable(char)[], uint*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[]*,
0x4a0bcb std.getopt.getoptImpl!(immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], bool*, immutable(char)[], dircmp.probables*, immutable(char)[], uint*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*
0x4a0925 std.getopt.getoptImpl!(immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], bool*, immutable(char)[], dircmp.probables*, immutable(char)[], uint*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[][]*
0x4a0669 std.getopt.getoptImpl!(immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], bool*, immutable(char)[], dircmp.probables*, immutable(char)[], uint*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(char)[], immutable(char)[]*
0x4a039f std.getopt.getoptImpl!(immutable(char)[], bool*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], bool*, immutable(char)[], dircmp.probables*, immutable(char)[], uint*, immutable(char)[], bool*, immutable(char)[], immutable(char)[]*, immutable(
0x4a00bf std.getopt.getoptImpl!(immutable(char)[], bool*, immutable(char)[], bool*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], bool*, immutable(char)[], dircmp.probables*, immutable(char)[], uint*, immutable(char)[], bool*, immutable(char)[],
0x49f2aa std.getopt.getoptImpl!(immutable(char)[], immutable(char)[][]*, immutable(char)[], bool*, immutable(char)[], bool*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], bool*, immutable(char)[], dircmp.probables*, immutable(char)[], uint*,
0x49e43f std.getopt.getoptImpl!(immutable(char)[], bool*, immutable(char)[], immutable(char)[][]*, immutable(char)[], bool*, immutable(char)[], bool*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], bool*, immutable(char)[], dircmp.probables*,
0x49d90e std.getopt.getoptImpl!(immutable(char)[], void delegate(), immutable(char)[], bool*, immutable(char)[], immutable(char)[][]*, immutable(char)[], bool*, immutable(char)[], bool*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], bool*, immutable(
0x49d5ca std.getopt.getopt!(immutable(char)[], void delegate(), immutable(char)[], bool*, immutable(char)[], immutable(char)[][]*, immutable(char)[], bool*, immutable(char)[], bool*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], immutable(char)[][]*, immutable(char)[], bool*, immutable(char)
0x418b99 _Dmain
???:0
0x4c5c3e void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll().void __lambda1()
../../../../src/libphobos/libdruntime/rt/dmain2.d:408
0x4c5eae void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())
../../../../src/libphobos/libdruntime/rt/dmain2.d:383
0x4c6108 void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).runAll()
../../../../src/libphobos/libdruntime/rt/dmain2.d:408
0x4c5eae void rt.dmain2._d_run_main(int, char**, extern (C) int function(char[][])*).tryExec(scope void delegate())
../../../../src/libphobos/libdruntime/rt/dmain2.d:383
0x4c6035 _d_run_main
../../../../src/libphobos/libdruntime/rt/dmain2.d:416
0x40658a main
???:0
0x7ffe22d54b44 __libc_start_main
???:0
0x406492 ???
???:0
0xffffffffffffffff ???
???:0
````

After:
````
Unrecognized option -asdf
````

I submit the latter is far more useful. :-)