config: add 'set' command

This commit is contained in:
Dominique Martinet 2017-12-29 15:31:04 +01:00
parent c5452a3220
commit c83900593d
5 changed files with 81 additions and 2 deletions

View file

@ -138,6 +138,7 @@ static struct cmd_handler handlers[] = {
{ "input", cmd_input },
{ "output", cmd_output },
{ "seat", cmd_seat },
{ "set", cmd_set },
};
static int handler_compare(const void *_a, const void *_b) {
@ -290,7 +291,7 @@ struct cmd_results *config_command(char *exec, enum cmd_status block) {
int i;
// Var replacement, for all but first argument of set
// TODO commands
for (i = /*handler->handle == cmd_set ? 2 :*/ 1; i < argc; ++i) {
for (i = handler->handle == cmd_set ? 2 : 1; i < argc; ++i) {
argv[i] = do_var_replacement(argv[i]);
unescape_string(argv[i]);
}