patchGNU Gengetopt - Patches: patch #7745, Another to ignore unknown arguments


You are not allowed to post comments on this tracker with your current authentification level.

patch #7745: Another to ignore unknown arguments

Submitted by:  Ronnie Lazar <ronniel>
Submitted on:  Sun Mar 18 19:22:21 2012  
Category: NonePriority: 5 - Normal
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open

Mon Apr 23 15:11:32 2012, comment #4:

Another try for the patch.
The reason for this patch is to support a mode where some of the command line options are parsed by gengetopts, and some by some other function.
We have an infra structure where we provide a sort of process skeleton. The user calls our skeleton with different callbacks, we perform the appropriate process initialization, and than invoke the callbacks for user(process) specific operation.
Our infra parses some of the command line options, and the rest are passed on to the user's callback.
This patch include changes to support:
1 - tell gengeopt parser to ignore unknown params
2 - allow user to override package name and version
3 - user can provide a function to print details of the options handled outside of gengetopts


(file #25716)

Ronnie Lazar <ronniel>
Mon Mar 26 21:40:07 2012, comment #3:

but is a generated file (starting from c_source.h_skel) and will be completely replaced when regenerated...

Lorenzo Bettini <bettini>
Project Administrator
Mon Mar 26 19:41:42 2012, comment #2:

The usage is in skels/

+ stream << " if (!params->ignore_unknowns)";
+ stream << "\n";
+ stream << " {";
+ stream << "\n";

Ronnie Lazar <ronniel>
Wed Mar 21 14:04:11 2012, comment #1:

I think the patch is incomplete: the modifications to c_source.h_skel for instance provide only the declaration of the new parameter but not its use...

Lorenzo Bettini <bettini>
Project Administrator
Sun Mar 18 19:22:21 2012, original submission:

Added another option to cmdline_parser_params.
This option controls if the argument parsing code aborts on unknown arguments (returned from getopts_long) or ignores the error and continue parsing the command line

Ronnie Lazar <ronniel>



Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by bettini (Posted a comment)
  • -unavailable- added by ronniel (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon Apr 23 15:11:32 2012ronnielAttached File-=>Added 0001-updated-gitignore-and-adapted-to-support-ignored-par.patch, #25716
    Sun Mar 18 19:22:21 2012ronnielAttached File-=>Added 0001-Added-option-to-ignore-getopt_long-error-of-unknown-.patch, #25397

    Back to the top

    Powered by Savane 3.1-cleanup1