From 72fb0ef8b2749383dccba5149e27f670622e4ee5 Mon Sep 17 00:00:00 2001 From: Hackerpilot Date: Tue, 26 Jan 2016 23:35:26 -0800 Subject: [PATCH] Make help text comply with docopt standard --- src/main.d | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/src/main.d b/src/main.d index 1ab5144..7eedbc5 100644 --- a/src/main.d +++ b/src/main.d @@ -346,70 +346,72 @@ void printHelp(string programName) { stderr.writefln( ` - Usage: %s options + Usage: %s -options: - --help | -h +Options: + --help, -h Prints this help message --version Prints the program version - --sloc | -l [sourceFiles] + --sloc ..., -l ... Prints the number of logical lines of code in the given source files. If no files are specified, input is read from stdin. - --tokenCount | -t [sourceFiles] + --tokenCount ..., -t ... Prints the number of tokens in the given source files. If no files are specified, input is read from stdin. - --highlight [sourceFile] - Syntax-highlight the given source file. The - resulting HTML will be written to standard output. If no files are - specified, input is read from stdin. + --highlight + Syntax-highlight the given source file. The resulting HTML will be + written to standard output. If no file is specified, input is read + from stdin. - --imports | -i [sourceFile] + --imports , -i Prints modules imported by the given source file. If no files are specified, input is read from stdin. - --syntaxCheck | -s [sourceFile] + --syntaxCheck , -s Lexes and parses sourceFile, printing the line and column number of any syntax errors to stdout. One error or warning is printed per line. If no files are specified, input is read from stdin. %1$s will exit with a status code of zero if no errors are found, 1 otherwise. - --styleCheck | -S [sourceFiles] + --styleCheck ..., ... Lexes and parses sourceFiles, printing the line and column number of any static analysis check failures stdout. %1$s will exit with a status code of zero if no warnings or errors are found, 1 otherwise. - --ctags | -c sourceFile + --ctags ..., -c ... Generates ctags information from the given source code file. Note that ctags information requires a filename, so stdin cannot be used in place of a filename. - --etags | -e sourceFile + --etags ..., -e ... Generates etags information from the given source code file. Note that etags information requires a filename, so stdin cannot be used in place of a filename. - --etagsAll sourceFile + --etagsAll ... Same as --etags except private and package declarations are tagged too. - --ast | --xml sourceFile + --ast | --xml Generates an XML representation of the source files abstract syntax tree. If no files are specified, input is read from stdin. - --declaration | -d symbolName [sourceFiles sourceDirectories] + --declaration ..., + -d ... Find the location where symbolName is declared. This should be more accurate than "grep". Searches the given files and directories, or the current working directory if none are specified. - --report [sourceFiles sourceDirectories] + --report ... Generate a static analysis report in JSON format. Implies --styleCheck, however the exit code will still be zero if errors or warnings are found. - --config configFile + --config Use the given configuration file instead of the default located in $HOME/.config/dscanner/dscanner.ini