1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-07-01 07:59:00 +00:00

show argument types, like pdftohtml/pdftocairo/etc

This commit is contained in:
John Hewson 2013-01-28 22:30:04 +00:00
parent 35d9668e90
commit 81ee37e4ae

View File

@ -39,6 +39,23 @@ void dump_value(std::ostream & out, const T & v)
extern void dump_value(std::ostream & out, const std::string & v);
// type names helper
template<typename>
struct type_name {
static char const* value() { return "unknown"; }
};
template<> struct type_name<int> {
static char const* value() { return "int"; }
};
template<> struct type_name<double> {
static char const* value() { return "fp"; }
};
template<> struct type_name<std::string> {
static char const* value() { return "string"; }
};
class ArgParser
{
@ -161,7 +178,7 @@ void ArgParser::ArgEntry<T, Tv>::show_usage(std::ostream & out) const
if(need_arg)
{
sout << " <arg>";
sout << " <" << type_name<T>::value() << ">";
}
std::string s = sout.str();