Created
February 16, 2019 01:53
-
-
Save cyian-1756/37bbe3f2a2a51b453b21c6537a5fb81d to your computer and use it in GitHub Desktop.
Showing some weird behaviour from std.getopt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.getopt; | |
import std.stdio; | |
string folder; | |
bool useRealSize; | |
bool printReport; | |
bool printSummery; | |
bool printTSV; | |
string outputFile; | |
void main(string[] args) | |
{ | |
auto helpInformation = getopt( | |
args, | |
"f|folder", "The folder to scan", &folder, | |
"rs|realSize", "If true program use true unit sizes for storage", &useRealSize, | |
"pt|print-tsv", "Print report as a TSV", &printTSV, | |
"p|print-report", "Print report", &printReport, | |
"s|print-summery", "Print a summery at the end of the report", &printSummery, | |
"o|output", "Write the file instead of stdout", &outputFile | |
); | |
if (helpInformation.helpWanted) { | |
defaultGetoptPrinter("Test", helpInformation.options); | |
return; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment