Click here to Skip to main content
11,703,505 members (74,461 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Another argument parsing function for C and C++

, 18 Oct 2013 MIT 12.1K 255 26
Argument parsing function identifies both optional and positional arguments.

Revisions


  

Compare Revision Minor Date Status Editor
19 - publicly available Yes 19-Oct-13 1:18 Available Bill_Hallahan
The article has been approved
18 No 18-Oct-13 18:37 Pending Bill_Hallahan
Fixed an argument parsing bug where if there was no long switch name early in the option argument array, the search for a matching long switch name was terminated prematurely. The code now compiles u
16 No 13-Oct-13 21:24 Pending Bill_Hallahan
Removed copyright notice that had "All Rights Reserved" in file ParseExample.c
15 No 13-Oct-13 20:25 Pending Bill_Hallahan
Fixed another comment.
14 No 13-Oct-13 20:09 Pending Bill_Hallahan
Corrected a comment.
13 No 13-Oct-13 20:00 Pending Bill_Hallahan
I decided to dissallow switch names of the form "-." and "-+', as these could be the start of a number.
11 No 12-Oct-13 19:03 Pending Bill_Hallahan
Updates in content. Changes: 1224
10 No 12-Oct-13 15:41 Pending Bill_Hallahan
Updates in content. Changes: 744
9 No 12-Oct-13 15:29 Pending Bill_Hallahan
Updates in content. Changes: 381
8 No 12-Oct-13 15:23 Pending Bill_Hallahan
Updates in content. Changes: 6987
7 No 11-Oct-13 22:15 Pending Bill_Hallahan
Updates in content.
6 No 11-Oct-13 22:15 Pending Bill_Hallahan
Updates in content. Changes: 621
5 No 11-Oct-13 21:17 Pending Bill_Hallahan
I added the relevant code to the article. I also updated the get_arguments.h header file to document the use of the function. Finally, I updated the uploaded code.
2 No 11-Oct-13 1:33 Closed Bill_Hallahan
Updates in content. Changes: 30
1 No 11-Oct-13 1:27 Closed Bill_Hallahan
Initial creation

License

This article, along with any associated source code and files, is licensed under The MIT License

Share

About the Author

Bill_Hallahan
Software Developer (Senior)
United States United States
I'm an electrical engineer who has spend most of my career writing software. My background includes Digital Signal Processing, Multimedia programming, Robotics, Text-To-Speech, and Storage products. Most of the code that I've written is in C, C++ and Python. I know Object Oriented Design and I'm a proponent of Design Patterns.

My hobbies include writing software for fun, amateur radio, chess, and performing magic, mostly for charities.

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150819.1 | Last Updated 19 Oct 2013
Article Copyright 2013 by Bill_Hallahan
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid