More options for buddies

* Generic writer options
* Generic reader options
* All converter tools are equipped with writer options
* strm2gds is equipped with reader options already
This commit is contained in:
Matthias Koefferlein
2017-08-17 23:31:05 +02:00
parent dede3afe1b
commit aa3caeca07
13 changed files with 803 additions and 335 deletions
+6
View File
@@ -472,9 +472,15 @@ CommandLineOptions::parse (int argc, char *argv[])
for (std::vector<ArgBase *>::const_iterator i = m_args.begin (); i != m_args.end (); ++i) {
if ((*i)->is_option ()) {
if (! (*i)->option ().short_option.empty ()) {
if (arg_by_short_option.find ((*i)->option ().short_option) != arg_by_short_option.end ()) {
throw tl::Exception ("Command line parser setup: duplicate option -" + (*i)->option ().short_option);
}
arg_by_short_option.insert (std::make_pair ((*i)->option ().short_option, *i));
}
if (! (*i)->option ().long_option.empty ()) {
if (arg_by_long_option.find ((*i)->option ().long_option) != arg_by_long_option.end ()) {
throw tl::Exception ("Command line parser setup: duplicate option --" + (*i)->option ().long_option);
}
arg_by_long_option.insert (std::make_pair ((*i)->option ().long_option, *i));
}
} else {
+1 -7
View File
@@ -932,13 +932,7 @@ OutputStream::OutputStream (const std::string &abstract_path, OutputStreamMode o
: m_pos (0), mp_delegate (0), m_owns_delegate (false)
{
// Determine output mode
if (om == OM_Auto) {
if (tl::match_filename_to_format (abstract_path, "(*.gz *.gzip *.GZ *.GZIP)")) {
om = OM_Zlib;
} else {
om = OM_Plain;
}
}
om = output_mode_from_filename (abstract_path, om);
tl::Extractor ex (abstract_path.c_str ());
if (ex.test ("http:") || ex.test ("https:")) {