forked from kongaskristjan/fire-hpp
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'positional_arguments_with_Fire' into master
- Loading branch information
Showing
9 changed files
with
396 additions
and
209 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,4 +29,4 @@ int fired_main( | |
return 0; | ||
} | ||
|
||
FIRE_NO_SPACE_ASSIGNMENT(fired_main) | ||
FIRE(fired_main) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
/* | ||
Copyright (c) 2020 Kristjan Kongas | ||
Permission to use, copy, modify, and/or distribute this software for any | ||
purpose with or without fee is hereby granted. | ||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH | ||
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | ||
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM | ||
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR | ||
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR | ||
PERFORMANCE OF THIS SOFTWARE. | ||
*/ | ||
|
||
#include <iostream> | ||
#include "../fire.hpp" | ||
|
||
using namespace std; | ||
|
||
int fired_main( | ||
unsigned repeats = fire::arg({"-r", "--repeats", "Number of repeats"}, 1), | ||
vector<string> strings = fire::arg::vector("Optional positive integer") | ||
) { | ||
for(unsigned i = 0; i < repeats; ++i) { | ||
for(string &s: strings) { | ||
cout << s << " "; | ||
} | ||
cout << endl; | ||
} | ||
return 0; | ||
} | ||
|
||
FIRE_NO_SPACE_ASSIGNMENT(fired_main) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,4 @@ int fired_main( | |
return 0; | ||
} | ||
|
||
FIRE_NO_SPACE_ASSIGNMENT(fired_main) | ||
FIRE(fired_main) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.