ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-4/src/applications/dynamicProps/DynamicPropsCmd.c
(Generate patch)

Comparing trunk/OOPSE-4/src/applications/dynamicProps/DynamicPropsCmd.c (file contents):
Revision 2204 by gezelter, Fri Apr 15 22:04:00 2005 UTC vs.
Revision 2668 by tim, Fri Mar 24 16:49:09 2006 UTC

# Line 1 | Line 1
1   /*
2    File autogenerated by gengetopt version 2.11
3    generated with the following command:
4 <  /home/maul/gezelter/tim/bin/gengetopt -F DynamicPropsCmd
4 >  /home/maul/gezelter/tim/program/gengetopt-2.11/src/gengetopt -F DynamicPropsCmd
5  
6    The developers of gengetopt consider the fixed text that goes in all
7    gengetopt output files to be in the public domain:
# Line 33 | Line 33 | cmdline_parser_print_help (void)
33   {
34    cmdline_parser_print_version ();
35    printf("\n"
36 <         "Usage: %s [OPTIONS]...\n", CMDLINE_PARSER_PACKAGE);
36 >  "Usage: %s [OPTIONS]...\n", CMDLINE_PARSER_PACKAGE);
37    printf("\n");
38    printf("  -h, --help                    Print help and exit\n");
39    printf("  -V, --version                 Print version and exit\n");
# Line 41 | Line 41 | cmdline_parser_print_help (void)
41    printf("  -o, --output=filename         output file name\n");
42    printf("      --sele1=selection script  select first stuntdouble set\n");
43    printf("      --sele2=selection script  select second stuntdouble set (if sele2 is not \n                                  set, use script from sele1)\n");
44 +  printf("      --order=INT               Lengendre Polynomial Order\n");
45    printf("\n");
46    printf(" Group: dynamicProps  an option of this group is required\n");
47 <  printf("  -r, --rcorr                   rmsd\n");
47 >  printf("  -m, --rmsd                    rmsd\n");
48 >  printf("  -r, --rcorr                   position correlation function\n");
49    printf("  -v, --vcorr                   velocity correlation function\n");
50    printf("  -d, --dcorr                   dipole correlation function\n");
51 +  printf("  -l, --lcorr                   Lengendre correlation function\n");
52   }
53  
54  
# Line 77 | Line 80 | cmdline_parser (int argc, char * const *argv, struct g
80    args_info->output_given = 0 ;
81    args_info->sele1_given = 0 ;
82    args_info->sele2_given = 0 ;
83 +  args_info->order_given = 0 ;
84 +  args_info->rmsd_given = 0 ;
85    args_info->rcorr_given = 0 ;
86    args_info->vcorr_given = 0 ;
87    args_info->dcorr_given = 0 ;
88 < #define clear_args() {                          \
89 <    args_info->input_arg = NULL;                \
90 <    args_info->output_arg = NULL;               \
91 <    args_info->sele1_arg = NULL;                \
92 <    args_info->sele2_arg = NULL;                \
93 <  }
88 >  args_info->lcorr_given = 0 ;
89 > #define clear_args() { \
90 >  args_info->input_arg = NULL; \
91 >  args_info->output_arg = NULL; \
92 >  args_info->sele1_arg = NULL; \
93 >  args_info->sele2_arg = NULL; \
94 > }
95  
96    clear_args();
97  
# Line 106 | Line 112 | cmdline_parser (int argc, char * const *argv, struct g
112          { "output",     1, NULL, 'o' },
113          { "sele1",      1, NULL, 0 },
114          { "sele2",      1, NULL, 0 },
115 +        { "order",      1, NULL, 0 },
116 +        { "rmsd",       0, NULL, 'm' },
117          { "rcorr",      0, NULL, 'r' },
118          { "vcorr",      0, NULL, 'v' },
119          { "dcorr",      0, NULL, 'd' },
120 +        { "lcorr",      0, NULL, 'l' },
121          { NULL, 0, NULL, 0 }
122        };
123  
124        stop_char = 0;
125 <      c = getopt_long (argc, argv, "hVi:o:rvd", long_options, &option_index);
125 >      c = getopt_long (argc, argv, "hVi:o:mrvdl", long_options, &option_index);
126  
127        if (c == -1) break;       /* Exit from `while (1)' loop.  */
128  
# Line 151 | Line 160 | cmdline_parser (int argc, char * const *argv, struct g
160            args_info->output_arg = gengetopt_strdup (optarg);
161            break;
162  
163 <        case 'r':       /* rmsd.  */
163 >        case 'm':       /* rmsd.  */
164 >          if (args_info->rmsd_given)
165 >            {
166 >              fprintf (stderr, "%s: `--rmsd' (`-m') option given more than once\n", CMDLINE_PARSER_PACKAGE);
167 >              clear_args ();
168 >              exit (EXIT_FAILURE);
169 >            }
170 >          args_info->rmsd_given = 1;
171 >          dynamicProps_group_counter += 1;
172 >        break;
173 >
174 >        case 'r':       /* position correlation function.  */
175            if (args_info->rcorr_given)
176              {
177                fprintf (stderr, "%s: `--rcorr' (`-r') option given more than once\n", CMDLINE_PARSER_PACKAGE);
# Line 160 | Line 180 | cmdline_parser (int argc, char * const *argv, struct g
180              }
181            args_info->rcorr_given = 1;
182            dynamicProps_group_counter += 1;
183 <          break;
183 >        break;
184  
185          case 'v':       /* velocity correlation function.  */
186            if (args_info->vcorr_given)
# Line 171 | Line 191 | cmdline_parser (int argc, char * const *argv, struct g
191              }
192            args_info->vcorr_given = 1;
193            dynamicProps_group_counter += 1;
194 <          break;
194 >        break;
195  
196          case 'd':       /* dipole correlation function.  */
197            if (args_info->dcorr_given)
# Line 182 | Line 202 | cmdline_parser (int argc, char * const *argv, struct g
202              }
203            args_info->dcorr_given = 1;
204            dynamicProps_group_counter += 1;
205 <          break;
205 >        break;
206  
207 +        case 'l':       /* Lengendre correlation function.  */
208 +          if (args_info->lcorr_given)
209 +            {
210 +              fprintf (stderr, "%s: `--lcorr' (`-l') option given more than once\n", CMDLINE_PARSER_PACKAGE);
211 +              clear_args ();
212 +              exit (EXIT_FAILURE);
213 +            }
214 +          args_info->lcorr_given = 1;
215 +          dynamicProps_group_counter += 1;
216 +        break;
217  
218 +
219          case 0: /* Long option with no short option */
220            /* select first stuntdouble set.  */
221            if (strcmp (long_options[option_index].name, "sele1") == 0)
222 <            {
223 <              if (args_info->sele1_given)
224 <                {
225 <                  fprintf (stderr, "%s: `--sele1' option given more than once\n", CMDLINE_PARSER_PACKAGE);
226 <                  clear_args ();
227 <                  exit (EXIT_FAILURE);
228 <                }
229 <              args_info->sele1_given = 1;
230 <              args_info->sele1_arg = gengetopt_strdup (optarg);
231 <              break;
232 <            }
222 >          {
223 >            if (args_info->sele1_given)
224 >              {
225 >                fprintf (stderr, "%s: `--sele1' option given more than once\n", CMDLINE_PARSER_PACKAGE);
226 >                clear_args ();
227 >                exit (EXIT_FAILURE);
228 >              }
229 >            args_info->sele1_given = 1;
230 >            args_info->sele1_arg = gengetopt_strdup (optarg);
231 >            break;
232 >          }
233            
234            /* select second stuntdouble set (if sele2 is not set, use script from sele1).  */
235            else if (strcmp (long_options[option_index].name, "sele2") == 0)
236 <            {
237 <              if (args_info->sele2_given)
238 <                {
239 <                  fprintf (stderr, "%s: `--sele2' option given more than once\n", CMDLINE_PARSER_PACKAGE);
240 <                  clear_args ();
241 <                  exit (EXIT_FAILURE);
242 <                }
243 <              args_info->sele2_given = 1;
244 <              args_info->sele2_arg = gengetopt_strdup (optarg);
245 <              break;
246 <            }
236 >          {
237 >            if (args_info->sele2_given)
238 >              {
239 >                fprintf (stderr, "%s: `--sele2' option given more than once\n", CMDLINE_PARSER_PACKAGE);
240 >                clear_args ();
241 >                exit (EXIT_FAILURE);
242 >              }
243 >            args_info->sele2_given = 1;
244 >            args_info->sele2_arg = gengetopt_strdup (optarg);
245 >            break;
246 >          }
247            
248 +          /* Lengendre Polynomial Order.  */
249 +          else if (strcmp (long_options[option_index].name, "order") == 0)
250 +          {
251 +            if (args_info->order_given)
252 +              {
253 +                fprintf (stderr, "%s: `--order' option given more than once\n", CMDLINE_PARSER_PACKAGE);
254 +                clear_args ();
255 +                exit (EXIT_FAILURE);
256 +              }
257 +            args_info->order_given = 1;
258 +            args_info->order_arg = strtol (optarg,&stop_char,0);
259 +            break;
260 +          }
261 +          
262  
263          case '?':       /* Invalid option.  */
264            /* `getopt_long' already printed an error message.  */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines