baum

changeset 31:4e60d96265f0

removed -c option completely; updated man page; new error code 5
author meillo@marmaro.de
date Fri, 22 Feb 2008 14:57:04 +0100
parents cd979b979610
children 3903effae5ef
files README actions.c baum.1 baum.c
diffstat 4 files changed, 9 insertions(+), 17 deletions(-) [+]
line diff
     1.1 --- a/README	Fri Feb 22 14:47:47 2008 +0100
     1.2 +++ b/README	Fri Feb 22 14:57:04 2008 +0100
     1.3 @@ -17,11 +17,7 @@
     1.4  See man page or the examples that are shipped with the program to learn how to
     1.5  program in the baum language.
     1.6  
     1.7 -To check you sources run
     1.8 -
     1.9 -    baum -c sourcefile.baum
    1.10 -
    1.11 -If it exited successful, run the program with
    1.12 +Run a program with
    1.13  
    1.14      baum sourcefile.baum
    1.15  
     2.1 --- a/actions.c	Fri Feb 22 14:47:47 2008 +0100
     2.2 +++ b/actions.c	Fri Feb 22 14:57:04 2008 +0100
     2.3 @@ -40,7 +40,7 @@
     2.4  		return action_blackhole(node);
     2.5  
     2.6  	} else {
     2.7 -		fprintf(stderr, "unknown kind of node");
     2.8 +		fprintf(stderr, "unknown kind of node\n");
     2.9  		exit(4);
    2.10  	}
    2.11  }
     3.1 --- a/baum.1	Fri Feb 22 14:47:47 2008 +0100
     3.2 +++ b/baum.1	Fri Feb 22 14:57:04 2008 +0100
     3.3 @@ -1,4 +1,4 @@
     3.4 -.TH baum 1 "2008-02-13" "baum 0.1"
     3.5 +.TH baum 1 "2008-02-22" "baum 0.2"
     3.6  .SH NAME
     3.7  baum \- an esoteric programming language
     3.8  
     3.9 @@ -6,7 +6,7 @@
    3.10  
    3.11  .SH SYNOPSIS
    3.12  .B baum
    3.13 -[\-v]\ [\-c]\ <file>
    3.14 +[\-v]\ <file>
    3.15  
    3.16  
    3.17  
    3.18 @@ -28,10 +28,6 @@
    3.19  Verbose output
    3.20  
    3.21  .TP
    3.22 -.BI \-c
    3.23 -Check source file for validity. Return 0 if source code is valid and something else otherwise.
    3.24 -
    3.25 -.TP
    3.26  .BI \-\-help
    3.27  Print usage information
    3.28  
    3.29 @@ -90,6 +86,10 @@
    3.30  invalid node
    3.31  
    3.32  .TP
    3.33 +.BI 5
    3.34 +indention over more than one level
    3.35 +
    3.36 +.TP
    3.37  .BI 127
    3.38  invalid command line options
    3.39  
     4.1 --- a/baum.c	Fri Feb 22 14:47:47 2008 +0100
     4.2 +++ b/baum.c	Fri Feb 22 14:57:04 2008 +0100
     4.3 @@ -17,7 +17,6 @@
     4.4  #define VERSION "0.2"
     4.5  
     4.6  
     4.7 -int option_check = 0;
     4.8  int option_verbose = 0;
     4.9  
    4.10  struct Node* root = 0;
    4.11 @@ -178,7 +177,7 @@
    4.12  					/* if it goes more than one level down -> error */
    4.13  					if (indent - last_indent > 1) {
    4.14  						fprintf(stderr, "error: Indention over more than one level. Only indent by one!\n");
    4.15 -						exit(50);
    4.16 +						exit(5);
    4.17  					}
    4.18  					last_node->down = node;
    4.19  					push(last_node);
    4.20 @@ -246,12 +245,9 @@
    4.21  			printf("\
    4.22  baum --version        print version information and exit\n\
    4.23  baum --help           print this output\n\
    4.24 -baum [-v] -c <file>   (verbosly) check file and return 1 if invalid\n\
    4.25  baum [-v] <file>      (verbosly) run file\n\
    4.26  ");
    4.27  			exit(0);
    4.28 -		} else if (strcmp(argv[0], "-c") == 0) {
    4.29 -			option_check = 1;
    4.30  		} else if (strcmp(argv[0], "-v") == 0) {
    4.31  			option_verbose = 1;
    4.32  			/*