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 18 Mar 2012 07:22:21 PM UTC  
 
Category: NonePriority: 5 - Normal
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open

Mon 23 Apr 2012 03:11:32 PM UTC, 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

Regards,
Ronnie

(file #25716)

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

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

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

The usage is in skels/c_source.cc:

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

Ronnie Lazar <ronniel>
Wed 21 Mar 2012 02:04:11 PM UTC, 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 18 Mar 2012 07:22:21 PM UTC, 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 23 Apr 2012 03:11:32 PM UTCronnielAttached File-=>Added 0001-updated-gitignore-and-adapted-to-support-ignored-par.patch, #25716
    Sun 18 Mar 2012 07:22:21 PM UTCronnielAttached File-=>Added 0001-Added-option-to-ignore-getopt_long-error-of-unknown-.patch, #25397

    Back to the top


    Powered by Savane 3.1-cleanup