mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-13 10:43:37 +00:00
client: Don't use basename for argv[0] in --help output
This isn't what other apps do, and it had issues in the OSX port, so just remove this.
This commit is contained in:
parent
a5abceccb2
commit
2626419da6
@ -428,29 +428,13 @@ char* CmdLineParser::next_argument()
|
||||
return _argv[optind++];
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
char* basename(char *str)
|
||||
{
|
||||
char *base;
|
||||
if ((base = strrchr(str, '\\'))) {
|
||||
return base;
|
||||
}
|
||||
|
||||
if ((base = strrchr(str, ':'))) {
|
||||
return base;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void CmdLineParser::show_help()
|
||||
{
|
||||
static const int HELP_START_POS = 30;
|
||||
static const int HELP_WIDTH = 80 - HELP_START_POS;
|
||||
std::ostringstream os;
|
||||
|
||||
os << basename(_argv[0]) << " - " << _description.c_str() << "\n\noptions:\n\n";
|
||||
os << _argv[0] << " - " << _description.c_str() << "\n\noptions:\n\n";
|
||||
|
||||
Options::iterator iter = _options.begin();
|
||||
for (; iter != _options.end(); ++iter) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user