What's the proper way to use std.getopt?

Jon Degenhardt jond at noreply.com
Tue Dec 12 20:57:28 UTC 2017


On Monday, 11 December 2017 at 20:58:25 UTC, Jordi Gutiérrez 
Hermoso wrote:
> What's the proper style, then? Can someone show me a good 
> example of how to use getopt and the docstring it automatically 
> generates?

The command line tools I published use the approach described in 
a number of the replies, but with a tad more structure. It's 
hardly perfect, but may be useful if you want more examples. See: 
  
https://github.com/eBay/tsv-utils-dlang/blob/master/tsv-sample/src/tsv-sample.d. See the main() routine and the TsvSampleOptions struct. Most of the tools have a similar pattern.

--Jon


More information about the Digitalmars-d-learn mailing list