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
This commit is contained in:
Daniel Aarno 2017-08-24 23:13:13 +01:00
parent 1a40e8f5a8
commit 7ab738957c
4 changed files with 18 additions and 2 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);

View File

@ -1,2 +1,10 @@
This feature appears broken!
#compdef test25
# test25 version 0.99
_arguments -s -S \
'*(-A --sA)'{-A,--sA}'[exist Test A]:integer' \
'(-s --Bs -B --sB)'{-B,--sB}'[exist Test B]' \
'(-s --Bs -B --sB)'{-s,--Bs}'[string test]:string' \
'(-)--version[displays version information and exits]' \
'(-)'{-h,--help}'[displays usage information and exits]'

View File

@ -5,7 +5,7 @@
# updated
../examples/test25 -h > tmp.out 2>&1
if cmp -s tmp.out $srcdir/test82.out; then
if cmp -s tmp.out $srcdir/test85.out; then
exit 0
else
exit 1