Fix bug from the modified completion builtin where a completion that specified no switches would be ignored

darcs-hash:20060122233000-ac50b-779c3bbb08d1bdaaa6c6eae6192413d6b71aff21.gz
This commit is contained in:
axel 2006-01-23 09:30:00 +10:00
parent 7f01570caf
commit 0ccc657aa6

View file

@ -39,43 +39,57 @@ static void builtin_complete_add2( const wchar_t *cmd,
for( s=short_opt; *s; s++ )
{
complete_add( cmd,
cmd_type,
*s,
0,
0,
result_mode,
authorative,
condition,
comp,
desc );
cmd_type,
*s,
0,
0,
result_mode,
authorative,
condition,
comp,
desc );
}
for( i=0; i<al_get_count( gnu_opt ); i++ )
{
complete_add( cmd,
cmd_type,
0,
(wchar_t *)al_get(gnu_opt, i ),
0,
result_mode,
authorative,
condition,
comp,
desc );
cmd_type,
0,
(wchar_t *)al_get(gnu_opt, i ),
0,
result_mode,
authorative,
condition,
comp,
desc );
}
for( i=0; i<al_get_count( old_opt ); i++ )
{
complete_add( cmd,
cmd_type,
0,
(wchar_t *)al_get(old_opt, i ),
1,
result_mode,
authorative,
condition,
comp,
desc );
cmd_type,
0,
(wchar_t *)al_get(old_opt, i ),
1,
result_mode,
authorative,
condition,
comp,
desc );
}
if( al_get_count( old_opt )+al_get_count( gnu_opt )+wcslen(short_opt) == 0 )
{
complete_add( cmd,
cmd_type,
0,
0,
0,
result_mode,
authorative,
condition,
comp,
desc );
}
}