ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/SHAPES/visualizerCmd.c
(Generate patch)

Comparing trunk/SHAPES/visualizerCmd.c (file contents):
Revision 1300 by gezelter, Thu Jun 24 19:06:47 2004 UTC vs.
Revision 1315 by chrisfen, Mon Jun 28 23:05:25 2004 UTC

# Line 40 | Line 40 | void clear_given (struct gengetopt_args_info *args_inf
40    args_info->shape_given = 0 ;
41    args_info->output_given = 0 ;
42    args_info->grid_given = 0 ;
43 +  args_info->range_given = 0 ;
44   }
45  
46   static
# Line 48 | Line 49 | void clear_args (struct gengetopt_args_info *args_info
49    args_info->shape_arg = NULL;
50    args_info->output_arg = NULL;
51    args_info->grid_arg = 101 ;
52 +  args_info->range_arg = 10 ;
53   }
54  
55   void
# Line 68 | Line 70 | cmdline_parser_print_help (void)
70    printf("%s\n","  -s, --shape=filename   shape file name");
71    printf("%s\n","  -o, --output=filename  output file name");
72    printf("%s\n","  -g, --grid=INT         number of grid points in each coordinate  (default=\n                           `101')");
73 +  printf("%s\n","  -r, --range=DOUBLE     the sample range for the points in Angstroms (Ex: 10 =\n                            -10 to 10)  (default=`10')");
74   }
75  
76   void
# Line 162 | Line 165 | cmdline_parser_internal (int argc, char * const *argv,
165          { "shape",      1, NULL, 's' },
166          { "output",     1, NULL, 'o' },
167          { "grid",       1, NULL, 'g' },
168 +        { "range",      1, NULL, 'r' },
169          { NULL, 0, NULL, 0 }
170        };
171  
172        stop_char = 0;
173 <      c = getopt_long (argc, argv, "hVs:o:g:", long_options, &option_index);
173 >      c = getopt_long (argc, argv, "hVs:o:g:r:", long_options, &option_index);
174  
175        if (c == -1) break;       /* Exit from `while (1)' loop.  */
176  
# Line 223 | Line 227 | cmdline_parser_internal (int argc, char * const *argv,
227            args_info->grid_arg = strtol (optarg,&stop_char,0);
228            break;
229  
230 +        case 'r':       /* the sample range for the points in Angstroms (Ex: 10 = -10 to 10).  */
231 +          if (local_args_info.range_given)
232 +            {
233 +              fprintf (stderr, "%s: `--range' (`-r') option given more than once%s\n", CMDLINE_PARSER_PACKAGE, (additional_error ? additional_error : ""));
234 +              goto failure;
235 +            }
236 +          if (args_info->range_given && ! override)
237 +            continue;
238 +          local_args_info.range_given = 1;
239 +          args_info->range_given = 1;
240 +          args_info->range_arg = strtod (optarg, NULL);
241 +          break;
242  
243 +
244          case 0: /* Long option with no short option */
245  
246          case '?':       /* Invalid option.  */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines