+ num_atts = ret;
+ sl = para_realloc(sl, (2 * num_atts + 1) * sizeof(char *));
+ for (i = 0; i < num_atts; i++) {
+ char *orig = sl[i];
+ sl[i] = make_message("%s+", orig);
+ sl[num_atts + i] = make_message("%s-", orig);
+ free(orig);
+ }
+ sl[2 * num_atts] = NULL;
+ ret = i9e_extract_completions(ci->word, sl, &cr->matches);
+out:
+ free(buf);
+ free_argv(sl);
+}
+
+static void lsatt_completer(struct i9e_completion_info *ci,
+ struct i9e_completion_result *cr)
+{
+ char *opts[] = {"-i", "-l", "-r", NULL};
+
+ if (ci->word[0] == '-')
+ i9e_complete_option(opts, ci, cr);
+ else
+ complete_attributes(ci->word, &cr->matches);
+}
+
+static void mvatt_completer(struct i9e_completion_info *ci,
+ struct i9e_completion_result *cr)
+{
+ complete_attributes(ci->word, &cr->matches);
+}
+
+static void rmatt_completer(struct i9e_completion_info *ci,
+ struct i9e_completion_result *cr)
+{
+ complete_attributes(ci->word, &cr->matches);
+}
+
+static void check_completer(struct i9e_completion_info *ci,
+ struct i9e_completion_result *cr)
+{
+ char *opts[] = {"-a", "-m", "-p", NULL};
+ i9e_complete_option(opts, ci, cr);
+}
+
+static void rm_completer(struct i9e_completion_info *ci,
+ struct i9e_completion_result *cr)
+{
+ char *opts[] = {"-v", "-f", "-p", NULL};
+
+ if (ci->word[0] == '-') {
+ i9e_complete_option(opts, ci, cr);
+ return;
+ }
+ cr->filename_completion_desired = true;
+}
+
+static void touch_completer(struct i9e_completion_info *ci,
+ struct i9e_completion_result *cr)
+{
+ char *opts[] = {"-n=", "-l=", "-y=", "-i=", "-a=", "-v", "-p", NULL};
+
+ if (ci->word[0] == '-')
+ i9e_complete_option(opts, ci, cr);
+ cr->filename_completion_desired = true;
+}
+
+static void cpsi_completer(struct i9e_completion_info *ci,
+ struct i9e_completion_result *cr)
+{
+ char *opts[] = {"-a", "-y", "-i", "-l", "-n", "-v", NULL};
+
+ if (ci->word[0] == '-')
+ i9e_complete_option(opts, ci, cr);
+ cr->filename_completion_desired = true;
+}
+
+static void select_completer(struct i9e_completion_info *ci,
+ struct i9e_completion_result *cr)
+{
+ char *mood_buf, *pl_buf, **moods, **playlists, **mops;
+ int num_moods, num_pl, i, n, ret;
+
+ ret = execute_client_command("lsmood", &mood_buf);