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

 
 

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

patch #7745: Another to ignore unknown arguments

Submitter:  Ronnie Lazar <ronniel>
Submitted:  Sun 18 Mar 2012 07:22:21 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Invalid Privacy:  Public
Assigned to:  None Open/Closed:  Closed

Sun 19 May 2019 12:16:02 PM UTC, comment #5: 

Thank you for all the work, however this patch mixes three different changes together, please consider posting them as separate patches if you still want then to be accepted.

Thank you

Gray Wolf <gray_wolf>
Group administrator
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>
Group 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>
Group 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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-05-19 gray_wolf StatusNone Invalid
        Open/ClosedOpen Closed
    2012-04-23 ronniel Attached File- Added 0001-updated-gitignore-and-adapted-to-support-ignored-par.patch, #25716
    2012-03-18 ronniel Attached File- Added 0001-Added-option-to-ignore-getopt_long-error-of-unknown-.patch, #25397

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code