Releases: mshenoda/argy
v0.6.0
🚀 Argy v0.6.0 Release
Enhanced fluent API, POSIX style support, and customizable help output
✨ Key Features
🔗 Fluent Validation API
Clean, intuitive validation with method chaining:
// Existing (will continue to work)
cli.addString("--email", "Email").validate(Argy::IsEmail());
cli.addString("--file", "Input file").validate(Argy::IsFile());
cli.addInt("--port", "Port number").validate(Argy::IsValueInRange(1024, 65535);
cli.addInts("--ids", "User ids").validate(Argy::IsVectorInRange(0, 4096);
// New (simpler for built-in validators)
cli.addString("--email", "Email").isEmail();
cli.addString("--file", "Input file").isFile();
cli.addInt("--port", "Port number").isInRange(1024, 65535);
cli.addInts("--ids", "User ids").isInRange(0, 4096);Available methods: .isFile(), .isDirectory(), .isEmail(), .isUrl(), .isIPAddress(), .isNumeric(), .isAlpha(), .isInRange(), .isOneOf(), .isMatch(), etc.
⚡ POSIX -- Support
Handle files with special names safely:
./myapp --verbose -- --weird-filename.txt
./myapp -o output -- -file-with-dash.txtSpecial thanks to @McTwist for feedback and suggestion to support this
🎨 Custom Help Output
Professional help messages:
cli.setHelpHeader("MyApp v0.6.0"); // printed at the top of help output
cli.setHelpDescription("Process files with advanced options"); // printed after usage line, and before the arguments
cli.setHelpFooter("Visit myapp.com for more info"); // printed at the bottom of help outputSpecial thanks to @McTwist for feedback and suggestion of this feature
📊 What's Included
- Enhanced examples showcasing new features
- Comprehensive tests for POSIX and validation
- Updated documentation with fluent API patterns
Thanks to all users for feedback and suggestions!
v0.5.0
🎉 Argy v0.5.0 Release
🚀 Highlights
- New ParsedArgs API
Based on user feedback, Argy now returns aParsedArgsobject fromcli.parse().
This avoids coupling issues and makes it clear when arguments are available for access:The direct API (auto args = cli.parse(); auto count = args.get<int>("count"); auto verbose = args.get<bool>("verbose");
cli.getString(), etc.) remains available for backwards compatibility and user preference.
🛠️ Changes
- Added
ParsedArgsobject returned fromcli.parse(). - Updated all code samples and examples.
- Minor improvements to help output and error handling.
⚠️ Migration Notes
- Update your code:
Prefer using the new API:// Direct: std::string file = cli.getString("file"); // Decoupled: auto args = cli.parse(); std::string file = args.getString("file");
- The Direct API remains available if you prefer direct access.
🧹 Miscellaneous
- Minor bug fixes and internal refactoring.
- Improved CI coverage and documentation links.
Thanks to all users for feedback and suggestions!
v0.4.0
🎉 Argy v0.4.0 Release Notes
Enhanced validation, improved examples, and better documentation
🚀 New Features
Enhanced Argument Validation System
- Comprehensive Validation Framework: New built-in validators for robust argument parsing with type-specific validation
- Negative Number Support: Enhanced parsing to properly handle negative numbers in arguments
- Better Error Handling: Improved validation with clear error messages throughout the CliParser
- Enhanced Developer Experience: Extended validation capabilities for more reliable CLI applications
📚 Documentation & Examples
New Examples
- Basic Example: Added
examples/example_basic.cppdemonstrating fundamental usage patterns - Enhanced Existing Examples: Improved argument validation in
example_named.cppandexample_template.cpp
🧪 Testing
Comprehensive Test Coverage
- Validation Tests: Added extensive tests for various argument types and validation conditions
- Edge Case Testing: Enhanced test coverage for different parsing scenarios
- Robustness Testing: Improved test suite for argument validation edge cases
v0.3.0
Argy v0.3.0 - Release Notes:
Highlights
-
Added CI build/testing for FreeBSD
- The project now runs automated builds and tests on FreeBSD, improving cross-platform reliability.
-
API Change: Unified Aliases Support for Arguments
- The argument definition API now supports multiple aliases (e.g.,
-v,--visualize,-s,--show) using a single vector of names. - This change provides a clean, type-safe API and avoids ambiguous overloads that could break with string arguments.
- The argument definition API now supports multiple aliases (e.g.,
Old API (problematic overloads):
// Template method (old, ambiguous with string arguments)
cli.add<bool>("-v", "--visualize", "Visualize results");New API (vector of names, clean and extensible):
Template method:
cli.add<bool>({"-v", "--visualize", "-s", "--show"}, "Visualize results");Named convenience method:
cli.addBool({"-v", "--visualize"}, "Enable verbose output", false);- All aliases are specified in a single vector, eliminating overload ambiguity.
- The API is now consistent for all argument types, including positional and optional arguments.
- This approach avoids compiler overload issues and makes the codebase easier to maintain and extend.
Benefits of the New API
- Cleaner and More Intuitive: All aliases are defined together, making argument definitions easier to read and modify.
- Avoids Overload Ambiguity: No more overloads that break with string arguments; the API is type-safe and unambiguous.
- Extensible: Adding new aliases or argument types is straightforward and does not require new overloads.
Example Usage
Template Version
cli.add<bool>({"-v", "--visualize", "-s", "--show"}, "Visualize results");
cli.add<int>({"-c", "--count", "-n", "--num"}, "Number of items");
cli.add<string>("filename", "Input file");Named Convenience Methods
cli.addBool({"-v", "--verbose"}, "Enable verbose output", false);
cli.addInt({"-c", "--count", "-n", "--num"}, "Number of items", 10);
cli.addString("filename", "Input file");For more details, see the updated examples in examples/example_named.cpp and examples/example_template.cpp.
v0.2.0
Argy v0.2.0 Release Notes
✨ Major Changes
- Renamed Classes:
Parser→CliParserfor clarity and to avoid name clashes.- All examples and tests updated to use
CliParser.
- Exception Handling:
- Added specific exception classes for improved error reporting (e.g.,
InvalidArgumentException,DuplicateArgumentException,TypeMismatchException, etc.).
- Added specific exception classes for improved error reporting (e.g.,
- Argument Validation:
- Enhanced validation and type safety for argument parsing.
- Improved error messages for invalid or missing arguments.
🛠️ API Improvements
- Refactored Argument Addition:
- Methods for adding arguments are now more consistent.
- Removed unused initializer list.
- Configurable Help Output:
- Help output now supports colorization, which is configurable by the user.
- Enhanced help message formatting: Help output displays option types for better usability.
📚 Documentation
- README Updates:
- Expanded and clarified usage examples.
- Updated to reflect latest API and release tag.
🧹 Internal Refactoring
- Reorganized code for maintainability.
- Updated comments for clarity.
🧪 Examples & Tests
- Updated example files to match new API.
- Improved test coverage for new features.
Argy v0.2.0 brings a more robust, developer-friendly, and type-safe command-line parsing experience for modern C++.
v0.1.1
Argy v0.1.1 Release Notes
🛠 Improvements & Fixes:
- More robust duplicate argument detection for both short and long names.
- Improved internal normalization and lookup for argument names (handles all forms with/without dashes).
- Enhanced enforcement of naming conventions for short/long argument names.
- Explicit error messages for invalid argument definitions (e.g., positional arguments with defaults, empty names).
- Expanded overloads and convenience methods for adding arguments
- Improved error handling for unknown and missing arguments.
- Prevents overriding built-in help flags (--help, -h).
- Prevents positional arguments from having default values.
- Ensures boolean flags are never marked as required.
- Throws clear errors for invalid or duplicate argument names.
- Fixes edge cases in argument parsing (e.g., handling of list types and positional/optional distinction).
v0.1.0
🎉 v0.1.0 – First Beta Release
This is the initial beta release of argy, a C++ library for argument parsing.
🚀 Features
- Core argument parsing functionality with a straightforward API.
- Example usage for named and template-based arguments.
- Unit tests using doctest for reliability.
- CMake build system for easy setup.
🛠️ Improvements & Fixes
- Early bug fixes and usability improvements.
- Some advanced features are still under development.
- Documentation is incomplete and will be expanded.
💡 Feedback
We welcome feedback and suggestions to help improve argy.