+static void
+parse_character_option (const char *arg, const char *option_name, char *out)
+{
+ if (strlen (arg) != 1)
+ {
+ /* XXX support multibyte characters */
+ error (1, 0, _("%s argument must be a single character"), option_name);
+ }
+ *out = arg[0];
+}
+
+static bool
+parse_variables_option (const char *arg, struct dictionary *dict,
+ struct variable ***vars, size_t *n_vars)
+{
+ struct lexer *lexer = lex_create ();
+ lex_append (lexer, lex_reader_for_string (arg, locale_charset ()));
+ lex_get (lexer);
+
+ bool ok = parse_variables (lexer, dict, vars, n_vars, 0);
+ if (ok && (lex_token (lexer) != T_STOP && lex_token (lexer) != T_ENDCMD))
+ {
+ lex_error (lexer, _("expecting variable name"));
+ ok = false;
+ }
+
+ lex_destroy (lexer);
+ if (!ok)
+ {
+ free (*vars);
+ *vars = NULL;
+ *n_vars = 0;
+ }
+ return ok;
+}
+