diff --git a/COPYING b/COPYING index 987be0c..d573236 100644 --- a/COPYING +++ b/COPYING @@ -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 diff --git a/include/tclap/ZshCompletionOutput.h b/include/tclap/ZshCompletionOutput.h index d3f20f5..d2ce148 100644 --- a/include/tclap/ZshCompletionOutput.h +++ b/include/tclap/ZshCompletionOutput.h @@ -231,6 +231,12 @@ inline void ZshCompletionOutput::printOption(Arg* a, std::string mutex) if ( a->isValueRequired() ) { std::string arg = a->shortID(); + // Example arg: "[-A ] ... " + 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); diff --git a/tests/runtests.sh b/tests/runtests.sh old mode 100644 new mode 100755