Quick fix for ZshCompletionOutput test

The test was failing because elipsis changed from "..." to
"... ". This is a quick and dirty fix and should be cleaned up.

Also updated copyright notice

# Conflicts:
#	tests/test85.out
#	tests/test85.sh
This commit is contained in:
Daniel Aarno 2017-12-26 14:03:13 +01:00
parent 5879dff268
commit 68fb0f35a2
3 changed files with 8 additions and 0 deletions

View File

@ -1,6 +1,8 @@
Copyright (c) 2003 Michael E. Smoot
Copyright (c) 2004 Daniel Aarno
Copyright (c) 2017 Google Inc.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation

View File

@ -231,6 +231,12 @@ inline void ZshCompletionOutput::printOption(Arg* a, std::string mutex)
if ( a->isValueRequired() )
{
std::string arg = a->shortID();
// Example arg: "[-A <integer>] ... "
size_t pos = arg.rfind(" ... ");
if (pos != std::string::npos) {
arg.erase(pos);
}
arg.erase(0, arg.find_last_of(theDelimiter) + 1);
if ( arg.at(arg.length()-1) == ']' )
arg.erase(arg.length()-1);

0
tests/runtests.sh Normal file → Executable file
View File