Index: app/src/dgp/cmdline_dgp.ggo
===================================================================
--- app/src/dgp/cmdline_dgp.ggo	(revision df77b87018c36b8848d9856d2cf774d23600b66d)
+++ app/src/dgp/cmdline_dgp.ggo	(revision 3748bd1db46143a281581cb44dc804da0190cbc2)
@@ -3,5 +3,5 @@
 
 option	"grammar"	g	"Grammar file"
-				string typestr="filename" default="dgp.dgp"
+				string no typestr="filename"
 
 option  "long"		l	"Long output"
Index: app/src/dgp/dgc
===================================================================
--- app/src/dgp/dgc	(revision adb4c8d65ba8b406a1703d1c091bcf1af4bdfb3c)
+++ app/src/dgp/dgc	(revision 3748bd1db46143a281581cb44dc804da0190cbc2)
@@ -38,11 +38,11 @@
                 next unless length;
                 my ($name, $value) = split(/\s*=\s*/, $_, 2);
-                if(($name eq "catfile")or($name eq "c")){
+                if(($name eq "categories")or($name eq "c")){
                         $catfile=$value;
                 }
-                elsif(($name eq "dicfile")or($name eq "d")){
+                elsif(($name eq "dictionary")or($name eq "d")){
                         $dicfile=$value;
                 }
-                elsif(($name eq "gramfile")or($name eq "g")){
+                elsif(($name eq "grammar")or($name eq "g")){
                         $gramfile=$value;
                 }
@@ -61,8 +61,15 @@
 
 GetOptions("help|h" => \$help,
-	   "catfile|c=s" => \$catfile,
-	   "dicfile|d=s" => \$dicfile,
-	   "gramfile|g=s" => \$gramfile,
+	   "categories|c=s" => \$catfile,
+	   "dictionary|d=s" => \$dicfile,
+	   "grammar|g=s" => \$gramfile,
 	   "outputfile|o=s" => \$outputfile);
+
+my $homedir = $ENV{'HOME'};
+$catfile =~ s/~/$homedir/;
+$dicfile =~ s/~/$homedir/;
+$gramfile =~ s/~/$homedir/;
+$outputfile =~ s/~/$homedir/;
+
 
 if($help)
@@ -72,8 +79,8 @@
 
 Options:
-   --catfile -c filename	List of syntactic categories.
-   --dicfile -d filename        Dictionary.
-   --gramfile -g filename	List of grammar rules.
-   --outputfile -o filename	Output filename.
+   --categories -c filename	List of syntactic categories.
+   --dictionary -d filename     Dictionary.
+   --grammar -g filename	List of grammar rules.
+   --outputfile -o filename	Output file name.
    --help -h			Help.
 END
Index: app/src/dgp/grammar.hh
===================================================================
--- app/src/dgp/grammar.hh	(revision 0214596e4d70b25df913a24f19d50cb0f1b4a69f)
+++ app/src/dgp/grammar.hh	(revision 3748bd1db46143a281581cb44dc804da0190cbc2)
@@ -18,5 +18,5 @@
   //  enum CONSTR { SGL, OBL, LEFT, RIGHT, INIT, NONINIT, FIN, NONFIN };
 
-  Grammar() : types_sz(0), cats_sz(0) { } ;
+  Grammar() : types_sz(0), cats_sz(0) {} ;
   
   int types_sz;
Index: app/src/dgp/main.cc
===================================================================
--- app/src/dgp/main.cc	(revision df77b87018c36b8848d9856d2cf774d23600b66d)
+++ app/src/dgp/main.cc	(revision 3748bd1db46143a281581cb44dc804da0190cbc2)
@@ -20,4 +20,6 @@
 int segcount=0;
 char seg_mnode[MAXSEGMENTS];
+char grammarfile[255];
+
 
 Grammar grammar;
@@ -41,16 +43,11 @@
   process_common_options(&args,argv[0]);
 
-//   if(args.help_given) cmdline_parser_print_help ();
+  if(!args.grammar_given)
+    fprintf(stderr,"dgp: no grammar given\n");
 
-//   if(args.input_given)
-//     if(!(inputf=fopen(args.input_arg,"r")))
-//       fprintf(stderr,"dgp: input file not found: %s.\n", args.input_arg), exit(1);
+  expand_path(args.grammar_arg,grammarfile);
 
-//   if(args.output_given)
-//     if(!(outputf=fopen(args.output_arg,"w")))
-//       fprintf(stderr,"dgp: cannot open output file: %s.\n", args.output_arg), exit(1);
-
-  if(!(grammarf=fopen(args.grammar_arg,"r")))
-    fprintf(stderr,"dgp: grammar file not found: %s.\n", args.grammar_arg), exit(1);
+  if(!(grammarf=fopen(grammarfile,"r")))
+    fprintf(stderr,"dgp: grammar file not found: %s.\n", grammarfile), exit(1);
 
   if(args.debug_given) debug=true;
Index: app/src/dgp/mgraph.cc
===================================================================
--- app/src/dgp/mgraph.cc	(revision 28e9ae0020002f67cf91ba795ab44945930c0e98)
+++ app/src/dgp/mgraph.cc	(revision 3748bd1db46143a281581cb44dc804da0190cbc2)
@@ -23,6 +23,9 @@
   if(*cat) ++cat;
   
-  Cat::add(cat);
-  nodes[n].cat=cat;
+//  Cat::add(cat);
+  if(Cat::index(cat)>0)
+    nodes[n].cat=cat;
+  else
+    nodes[n].cat="NULL";
   
   nodes[n].pred.clear();
