Implement option -p to test if the lexer/parser can parse your configfile (specify -c before)

This commit is contained in:
Michael Stapelberg
2009-09-13 14:54:27 +02:00
parent 9dd975e974
commit 268bf71222
3 changed files with 66 additions and 39 deletions

View File

@ -165,7 +165,7 @@ int main(int argc, char *argv[], char *env[]) {
start_argv = argv;
while ((opt = getopt_long(argc, argv, "c:vah", long_options, &option_index)) != -1) {
while ((opt = getopt_long(argc, argv, "c:vahp", long_options, &option_index)) != -1) {
switch (opt) {
case 'a':
LOG("Autostart disabled using -a\n");
@ -177,6 +177,12 @@ int main(int argc, char *argv[], char *env[]) {
case 'v':
printf("i3 version " I3_VERSION " © 2009 Michael Stapelberg and contributors\n");
exit(EXIT_SUCCESS);
case 'p':
{
printf("parsing\n");
parse_file(override_configpath);
exit(0);
}
default:
fprintf(stderr, "Usage: %s [-c configfile] [-a] [-v]\n", argv[0]);
fprintf(stderr, "\n");