Skip to content

Instantly share code, notes, and snippets.

@cyian-1756
Created February 16, 2019 01:53
Show Gist options
  • Save cyian-1756/37bbe3f2a2a51b453b21c6537a5fb81d to your computer and use it in GitHub Desktop.
Save cyian-1756/37bbe3f2a2a51b453b21c6537a5fb81d to your computer and use it in GitHub Desktop.
Showing some weird behaviour from std.getopt
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