diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-06-09 18:29:31 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2020-06-11 10:25:02 +0300 |
commit | e1da4d682173d6adbc0e5c99ec1b3c8c9a948957 (patch) | |
tree | 5ca5df253b716d9a9672eee8dc9bdee10cb2d58e /libbutl/builtin-options.hxx | |
parent | 8483129b6a4746247fd7fb3b5554e10181ad937a (diff) |
Add date builtin
Diffstat (limited to 'libbutl/builtin-options.hxx')
-rw-r--r-- | libbutl/builtin-options.hxx | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/libbutl/builtin-options.hxx b/libbutl/builtin-options.hxx index 99d955d..b389298 100644 --- a/libbutl/builtin-options.hxx +++ b/libbutl/builtin-options.hxx @@ -390,6 +390,71 @@ namespace butl bool preserve_; }; + class date_options + { + public: + date_options (); + + // Return true if anything has been parsed. + // + bool + parse (int& argc, + char** argv, + bool erase = false, + ::butl::cli::unknown_mode option = ::butl::cli::unknown_mode::fail, + ::butl::cli::unknown_mode argument = ::butl::cli::unknown_mode::stop); + + bool + parse (int start, + int& argc, + char** argv, + bool erase = false, + ::butl::cli::unknown_mode option = ::butl::cli::unknown_mode::fail, + ::butl::cli::unknown_mode argument = ::butl::cli::unknown_mode::stop); + + bool + parse (int& argc, + char** argv, + int& end, + bool erase = false, + ::butl::cli::unknown_mode option = ::butl::cli::unknown_mode::fail, + ::butl::cli::unknown_mode argument = ::butl::cli::unknown_mode::stop); + + bool + parse (int start, + int& argc, + char** argv, + int& end, + bool erase = false, + ::butl::cli::unknown_mode option = ::butl::cli::unknown_mode::fail, + ::butl::cli::unknown_mode argument = ::butl::cli::unknown_mode::stop); + + bool + parse (::butl::cli::scanner&, + ::butl::cli::unknown_mode option = ::butl::cli::unknown_mode::fail, + ::butl::cli::unknown_mode argument = ::butl::cli::unknown_mode::stop); + + // Option accessors. + // + const bool& + utc () const; + + // Implementation details. + // + protected: + bool + _parse (const char*, ::butl::cli::scanner&); + + private: + bool + _parse (::butl::cli::scanner&, + ::butl::cli::unknown_mode option, + ::butl::cli::unknown_mode argument); + + public: + bool utc_; + }; + class ln_options { public: |