Adam Lesinski | 98aa3ad | 2015-04-06 11:46:52 -0700 | [diff] [blame] | 1 | #ifndef AAPT_FLAG_H |
| 2 | #define AAPT_FLAG_H |
| 3 | |
| 4 | #include "StringPiece.h" |
| 5 | |
| 6 | #include <functional> |
| 7 | #include <string> |
| 8 | #include <vector> |
| 9 | |
| 10 | namespace aapt { |
| 11 | namespace flag { |
| 12 | |
| 13 | void requiredFlag(const StringPiece& name, const StringPiece& description, |
| 14 | std::function<void(const StringPiece&)> action); |
| 15 | |
Adam Lesinski | d13fb24 | 2015-05-12 20:40:48 -0700 | [diff] [blame^] | 16 | void requiredFlag(const StringPiece& name, const StringPiece& description, |
| 17 | std::function<bool(const StringPiece&, std::string*)> action); |
| 18 | |
Adam Lesinski | 98aa3ad | 2015-04-06 11:46:52 -0700 | [diff] [blame] | 19 | void optionalFlag(const StringPiece& name, const StringPiece& description, |
| 20 | std::function<void(const StringPiece&)> action); |
| 21 | |
Adam Lesinski | 5886a92 | 2015-04-15 20:29:22 -0700 | [diff] [blame] | 22 | void optionalSwitch(const StringPiece& name, const StringPiece& description, bool resultWhenSet, |
| 23 | bool* result); |
Adam Lesinski | 98aa3ad | 2015-04-06 11:46:52 -0700 | [diff] [blame] | 24 | |
Adam Lesinski | 769de98 | 2015-04-10 19:43:55 -0700 | [diff] [blame] | 25 | void usageAndDie(const StringPiece& command); |
| 26 | |
Adam Lesinski | 98aa3ad | 2015-04-06 11:46:52 -0700 | [diff] [blame] | 27 | void parse(int argc, char** argv, const StringPiece& command); |
| 28 | |
| 29 | const std::vector<std::string>& getArgs(); |
| 30 | |
| 31 | } // namespace flag |
| 32 | } // namespace aapt |
| 33 | |
| 34 | #endif // AAPT_FLAG_H |