Programming-Idioms

History of Idiom 162 > diff from v2 to v3

Edit summary for version 3 :
[D] Comment emphasis

Version 2

2017-08-02, 21:41:18

Version 3

2017-08-02, 21:52:48

Idiom #162 Execute procedures depending on options

execute bat if b is a program option and fox if f is a program option.

Idiom #162 Execute procedures depending on options

execute bat if b is a program option and fox if f is a program option.

Imports
import std.getopt;
Imports
import std.getopt;
Code
void main(string[] args)
{
    void bat(){} void fox(){}
    getopt(args, "b", &bat, f, &fox);
}
Code
void main(string[] args)
{
    void bat(){} void fox(){}
    getopt(args, "b", &bat, f, &fox);
}
Comments bubble
std.getopt allows to associate functions to arguments
Comments bubble
std.getopt allows to associate functions to arguments.
Doc URL
https://dlang.org/phobos/std_getopt.html#.getopt
Doc URL
https://dlang.org/phobos/std_getopt.html#.getopt