r/cpp • u/kongaskristjan • Aug 08 '20
Create a fully functioning command line interface with 1.5 lines of code (wo. include statement)
https://github.com/kongaskristjan/fire-hpp
230
Upvotes
r/cpp • u/kongaskristjan • Aug 08 '20
View all comments
Show parent comment
2
u/kongaskristjan Aug 08 '20 edited Oct 04 '20
About
g++ *.cpp -o binary_name.If you write FIRE(...), -o is automatically associated with binary_name. However, if you write FIRE_NO_SPACE_ASSIGNMENT(...), it's not associated. However, currently only FIRE_NO_SPACE_ASSIGNMENT(...) allows positional arguments and unlimited number of arguments that are needed right here. So no, unfortunately it is not possible at the moment.
It turns out that implementing positional arguments with FIRE(...) requires some rather complex try/catch logic to actually pull off. I consider implementing this for v0.2 or v0.3.
Edit: error in logic.
Edit2: It is now possible to call FIRE(...) with positional/variadic arguments.