13 #ifndef __STOUT_FLAGS_FETCH_HPP__ 14 #define __STOUT_FLAGS_FETCH_HPP__ 46 const std::string
path = value.substr(7);
50 return Error(
"Error reading file '" + path +
"': " + read.
error());
53 return parse<T>(read.
get());
56 return parse<T>(value);
64 return parse<Path>(value);
74 return parse<SecurePathOrValue>(value);
79 #endif // __STOUT_FLAGS_FETCH_HPP__
Definition: errorbase.hpp:36
T & get()&
Definition: try.hpp:80
Try< T > fetch(const std::string &value)
Definition: fetch.hpp:38
static Try error(const E &e)
Definition: try.hpp:43
Result< std::string > read(int_fd fd, size_t size)
Definition: read.hpp:55
bool isError() const
Definition: try.hpp:78
Result< Credentials > read(const Path &path)
Definition: credentials.hpp:35
bool startsWith(const std::string &s, const std::string &prefix)
Definition: strings.hpp:381