/*
process command line, GNU style.
- this is Copyleft (c) 1996--2005 Han-Wen Nienhuys, <hanwen@cs.uu.nl>
+ this is Copyleft (c) 1996--2006 Han-Wen Nienhuys, <hanwen@xs4all.nl>
*/
#include "getopt-long.hh"
#include <cstdlib>
#include <iostream>
+using namespace std;
#include "config.hh"
#include "string-convert.hh"
assert (*optnm);
char const *endopt = strchr (optnm, '=');
- int searchlen = (endopt) ? endopt - optnm : strlen (optnm);
+ int searchlen = (endopt) ? endopt - optnm : strlen (optnm);
- found_option_=0;
- for (int i=0; i< table_len_; i++)
+ found_option_ = 0;
+ for (int i = 0; i < table_len_; i++)
{
char const *ln = option_a_[i].longname_str0_;
if (ln && !strncmp (ln, optnm, searchlen))
{
- found_option_ = option_a_+i;
+ found_option_ = option_a_ + i;
break;
}
}
array_index_++;
argument_index_ = 0;
-
if (found_option_->take_arg_str0_)
{
if (endopt)
array_index_++;
}
if (!optional_argument_str0_)
- {
- report (E_ARGEXPECT);
- }
+ report (E_ARGEXPECT);
return found_option_;
}
if (argument_index_)
return parseshort ();
- const char *argument = arg_value_char_a_a_[array_index_];
+ char const *argument = arg_value_char_a_a_[array_index_];
if (argument[0] != '-')
return 0;
return parseshort ();
}
else
- {
- return 0;
- }
+ return 0;
}
}
int wid = 0;
for (int i = 0; l[i].shortname_char_ || l[i].longname_str0_; i++)
- {
- wid = max (wid, l[i].str_for_help ().length ());
- }
+ wid = max (wid, l[i].str_for_help ().length ());
for (int i = 0; l[i].shortname_char_ || l[i].longname_str0_; i++)
{