[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: UPDATE: command: negation
- To: herbstluftwm _minus_ devel _at_ lists _dot_ sourceforge _dot_ net
- Subject: Re: UPDATE: command: negation
- From: Florian Bruhin <me _at_ the _minus_ compiler _dot_ org>
- Date: Thu, 29 Nov 2012 13:17:40 +0100
* Tyler Thomas Hart <tylerthomashart _at_ gmail _dot_ com> [2012-11-28 16:28:47 -0800]:
> As requested by Thorsten, here are my patches in plain text and not
> archived.
>
> ! COMMANDS
> "!" executes the provided commands, but inverts their return
> value. If the provided command returns a nonzero, "!" returns a 0, if the
> command returns a zero, "!" returns a 1.
>
> (1/3)
You might want to add a completion function so tab completion works.
In command.c inside g_completions[], add a line like:
{ "!", GE, 1, .function = complete_against_negation },
Then add a new function to command.c and command.h:
void complete_against_negation(int argc, char** argv, int position,
GString* output) {
complete_against_commands(argc - 1, argv + 1, position - 1, output);
}
Florian
--
() ascii ribbon campaign - stop html mail www.asciiribbon.org
/\ www.the-compiler.org | I love long mails http://email.is-not-s.ms/
It is far more impressive when others discover your good qualities without
your help. -- Miss Manners