getopt under windows - Unix

This is a discussion on getopt under windows - Unix ; Hi. Any chances that there is a similar thing to *nix's getopt() under windows? (It doesn't actually have to be too nifty, the requirement is just that it is stable.) Regards, Markus...

+ Reply to Thread
Results 1 to 10 of 10

Thread: getopt under windows

  1. getopt under windows

    Hi.

    Any chances that there is a similar thing to *nix's getopt() under
    windows? (It doesn't actually have to be too nifty, the requirement is
    just that it is stable.)

    Regards,
    Markus

  2. Re: getopt under windows

    Markus Mayer wrote:
    > Hi.
    >
    > Any chances that there is a similar thing to *nix's getopt() under
    > windows? (It doesn't actually have to be too nifty, the requirement is
    > just that it is stable.)


    Better yet - just go to the GNU or BSD sources and pull out their
    getopt.[ch] files and compile them into your code directly. I've done so
    with both and it's not hard. ISTR I had to adjust a few declarations and
    names to avoid collision with the built-in version but the result was an
    arg parser that was completely portable between Unix and Windows. Just
    remember to consider the issue of license (GNU vs BSD).

    HT

  3. Re: getopt under windows

    On Wednesday 07 Nov 2007 7:48 pm Henry Townsend
    wrote in article
    :

    > Markus Mayer wrote:
    >> Hi.
    >>
    >> Any chances that there is a similar thing to *nix's getopt() under
    >> windows? (It doesn't actually have to be too nifty, the requirement
    >> is just that it is stable.)

    >
    > Better yet - just go to the GNU or BSD sources and pull out their
    > getopt.[ch] files and compile them into your code directly.


    If he used source under a GPL license he might have to place his own
    program under GPL too.


  4. Re: getopt under windows

    santosh wrote:
    > On Wednesday 07 Nov 2007 7:48 pm Henry Townsend
    > wrote in article
    > :
    >
    >> Markus Mayer wrote:
    >>> Hi.
    >>>
    >>> Any chances that there is a similar thing to *nix's getopt() under
    >>> windows? (It doesn't actually have to be too nifty, the requirement
    >>> is just that it is stable.)

    >> Better yet - just go to the GNU or BSD sources and pull out their
    >> getopt.[ch] files and compile them into your code directly.

    >
    > If he used source under a GPL license he might have to place his own
    > program under GPL too.
    >


    No. Only unmodified part he used.
    He can have whatever license he wants, but if he used some code licensed
    with GPL, he has to provide the source for the used source, and mention
    it somewhere.

  5. Re: getopt under windows

    FrenKy writes:
    >santosh wrote:
    >> On Wednesday 07 Nov 2007 7:48 pm Henry Townsend
    >> wrote in article
    >> :
    >>
    >>> Markus Mayer wrote:
    >>>> Hi.
    >>>>
    >>>> Any chances that there is a similar thing to *nix's getopt() under
    >>>> windows? (It doesn't actually have to be too nifty, the requirement
    >>>> is just that it is stable.)
    >>> Better yet - just go to the GNU or BSD sources and pull out their
    >>> getopt.[ch] files and compile them into your code directly.

    >>
    >> If he used source under a GPL license he might have to place his own
    >> program under GPL too.
    >>

    >
    >No. Only unmodified part he used.
    >He can have whatever license he wants, but if he used some code licensed
    >with GPL, he has to provide the source for the used source, and mention
    >it somewhere.



    This is incorrect.

    If he uses the GPL code in a program he doesn't distribute (i.e. just uses
    himself), he need do nothing.

    If he uses the GPL code in a program he distributes in binary form to anyone,
    he must GPL his entire program. (LGPL code can be linked with a binary
    without this effect). There are grey areas specifically around dynamically
    loaded code, specifically kernel modules, as to where the viral nature of
    the GPL applies.

    As part of GPL'ing his program, he must offer the source to anyone to whom
    he distributes the binary (but he is not required to offer it to anyone who
    asks).

    scott

  6. Re: getopt under windows

    On Wed, 07 Nov 2007 22:13:55 +0100, FrenKy wrote:
    >santosh wrote:
    >> On Wednesday 07 Nov 2007 7:48 pm Henry Townsend
    >> wrote:
    >>
    >>>Markus Mayer wrote:
    >>>> Any chances that there is a similar thing to *nix's getopt() under
    >>>> windows? (It doesn't actually have to be too nifty, the requirement
    >>>> is just that it is stable.)
    >>>
    >>> Better yet - just go to the GNU or BSD sources and pull out their
    >>> getopt.[ch] files and compile them into your code directly.

    >>
    >> If he used source under a GPL license he might have to place his own
    >> program under GPL too.

    >
    > No. Only unmodified part he used.
    > He can have whatever license he wants, but if he used some code
    > licensed with GPL, he has to provide the source for the used source,
    > and mention it somewhere.


    I'm sorry, but you are wrong about the GPL, and santosh is right.
    Please, reread the GPLv2 or later versions, and pay special attention to
    the explanation of "derivative work" and "mere aggregation" in the
    license text.

    Giorgos


  7. Re: getopt under windows

    Giorgos Keramidas wrote:
    > On Wed, 07 Nov 2007 22:13:55 +0100, FrenKy wrote:
    >> santosh wrote:
    >>> On Wednesday 07 Nov 2007 7:48 pm Henry Townsend
    >>> wrote:
    >>>
    >>>> Markus Mayer wrote:
    >>>>> Any chances that there is a similar thing to *nix's getopt() under
    >>>>> windows? (It doesn't actually have to be too nifty, the requirement
    >>>>> is just that it is stable.)
    >>>> Better yet - just go to the GNU or BSD sources and pull out their
    >>>> getopt.[ch] files and compile them into your code directly.
    >>> If he used source under a GPL license he might have to place his own
    >>> program under GPL too.

    >> No. Only unmodified part he used.
    >> He can have whatever license he wants, but if he used some code
    >> licensed with GPL, he has to provide the source for the used source,
    >> and mention it somewhere.

    >
    > I'm sorry, but you are wrong about the GPL, and santosh is right.


    Santosh might be (and is) "right" but he started yet another @*&^$ GPL
    flame war by snipping the perfectly clear part of my post that said
    "Just remember to consider the issue of license (GNU vs BSD)". How clear
    does a person have to be? If you want GPL, use the GNU stuff. If not,
    use BSD. Enough already, this is about argument parsing, not GPL.

    HT

  8. Re: getopt under windows

    Am 07.11.2007 15:18 postulierte Henry Townsend folgendes:
    > Markus Mayer wrote:
    >> Hi.
    >>
    >> Any chances that there is a similar thing to *nix's getopt() under
    >> windows? (It doesn't actually have to be too nifty, the requirement is
    >> just that it is stable.)

    >
    > Better yet - just go to the GNU or BSD sources and pull out their
    > getopt.[ch] files and compile them into your code directly. I've done so
    > with both and it's not hard. ISTR I had to adjust a few declarations and
    > names to avoid collision with the built-in version but the result was an
    > arg parser that was completely portable between Unix and Windows. Just
    > remember to consider the issue of license (GNU vs BSD).
    >
    > HT


    This is what I have actually done in the meantime according to a hint in
    comp.lang.c - Thanks nevertheless!

    Best regards,
    Markus

  9. Re: getopt under windows

    On Wed, 07 Nov 2007 21:50:44 -0500, Henry Townsend wrote:
    >Giorgos Keramidas wrote:
    >>On Wed, 07 Nov 2007 22:13:55 +0100, FrenKy wrote:
    >>>santosh wrote:
    >>>>On Wednesday 07 Nov 2007 7:48 pm Henry Townsend
    >>>> wrote:
    >>>>> Markus Mayer wrote:
    >>>>>> Any chances that there is a similar thing to *nix's getopt() under
    >>>>>> windows? (It doesn't actually have to be too nifty, the requirement
    >>>>>> is just that it is stable.)
    >>>>>
    >>>>> Better yet - just go to the GNU or BSD sources and pull out their
    >>>>> getopt.[ch] files and compile them into your code directly.
    >>>>
    >>>> If he used source under a GPL license he might have to place his own
    >>>> program under GPL too.
    >>>
    >>> No. Only unmodified part he used.
    >>> He can have whatever license he wants, but if he used some code
    >>> licensed with GPL, he has to provide the source for the used source,
    >>> and mention it somewhere.

    >>
    >> I'm sorry, but you are wrong about the GPL, and santosh is right.

    >
    > Santosh might be (and is) "right" but he started yet another @*&^$ GPL
    > flame war by snipping the perfectly clear part of my post that said
    > "Just remember to consider the issue of license (GNU vs BSD)". How clear
    > does a person have to be? If you want GPL, use the GNU stuff. If not,
    > use BSD. Enough already, this is about argument parsing, not GPL.


    I know, Henry. I wasn't implying that what _you_ wrote was wrong. It
    was, in fact, pretty solid and good advice, AFAICT


  10. Re: getopt under windows

    Giorgos Keramidas wrote:
    > On Wed, 07 Nov 2007 21:50:44 -0500, Henry Townsend wrote:
    >> Giorgos Keramidas wrote:
    >>> On Wed, 07 Nov 2007 22:13:55 +0100, FrenKy wrote:
    >>>> santosh wrote:
    >>>>> On Wednesday 07 Nov 2007 7:48 pm Henry Townsend
    >>>>> wrote:
    >>>>>> Markus Mayer wrote:
    >>>>>>> Any chances that there is a similar thing to *nix's getopt() under
    >>>>>>> windows? (It doesn't actually have to be too nifty, the requirement
    >>>>>>> is just that it is stable.)
    >>>>>> Better yet - just go to the GNU or BSD sources and pull out their
    >>>>>> getopt.[ch] files and compile them into your code directly.
    >>>>> If he used source under a GPL license he might have to place his own
    >>>>> program under GPL too.
    >>>> No. Only unmodified part he used.
    >>>> He can have whatever license he wants, but if he used some code
    >>>> licensed with GPL, he has to provide the source for the used source,
    >>>> and mention it somewhere.
    >>> I'm sorry, but you are wrong about the GPL, and santosh is right.

    >> Santosh might be (and is) "right" but he started yet another @*&^$ GPL
    >> flame war by snipping the perfectly clear part of my post that said
    >> "Just remember to consider the issue of license (GNU vs BSD)". How clear
    >> does a person have to be? If you want GPL, use the GNU stuff. If not,
    >> use BSD. Enough already, this is about argument parsing, not GPL.

    >
    > I know, Henry. I wasn't implying that what _you_ wrote was wrong. It
    > was, in fact, pretty solid and good advice, AFAICT


    Understood, and of course my irritation was really directed at the above
    named person. I just expressed it in a response to your part in the thread.

    HT

+ Reply to Thread