Thread overview
[Issue 11123] New: std.getopt should support functions
Sep 25, 2013
Andrej Mitrovic
Sep 26, 2013
Andrej Mitrovic
Sep 27, 2013
Andrej Mitrovic
September 25, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11123

           Summary: std.getopt should support functions
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: andrej.mitrovich@gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-09-25 06:12:16 PDT ---
Currently getopt works with delegates, but not functions:

-----
import std.getopt;

void main(string[] args)
{
    static void test1(string)
    {
    }

    void test2(string)
    {
    }

    getopt(args,
        "test1", &test1,  // fails
        "test2", &test2);
}
-----

AFAICT I don't see any technical reason why functions shouldn't be supported.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 26, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11123



--- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-09-25 17:07:09 PDT ---
https://github.com/D-Programming-Language/phobos/pull/1601

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 27, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11123



--- Comment #2 from github-bugzilla@puremagic.com 2013-09-27 08:02:07 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/83852de6c12c3f05f5f5980861c3a46ad780ab6f Fixes Issue 11123 - std.getopt should support function callbacks.

https://github.com/D-Programming-Language/phobos/commit/1ceddc4f823fbdfa79a5024302fb7d405de887bb Merge pull request #1601 from AndrejMitrovic/Fix11123

Issue 11123 - std.getopt should support function callbacks.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 27, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11123


Andrej Mitrovic <andrej.mitrovich@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------