+static int cmd_sortby(struct zoom_sh *sh, const char **args)
+{
+ WRBUF strategy;
+ const char *criteria;
+ if (!(strategy = next_token_new_wrbuf(args)))
+ {
+ printf("missing argument argument: strategy and criteria\n");
+ return 1;
+ }
+ criteria = *args;
+ while (*criteria == ' ')
+ criteria++;
+ wrbuf_destroy(sh->strategy);
+ sh->strategy = strategy;
+
+ wrbuf_rewind(sh->criteria);
+ wrbuf_puts(sh->criteria, criteria);
+ return 0;
+}
+