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

Comparing trunk/OOPSE-4/src/applications/hydrodynamics/HydroCmd.c (file contents):
Revision 2634 by tim, Fri Mar 17 23:20:35 2006 UTC vs.
Revision 2675 by tim, Wed Mar 29 18:09:26 2006 UTC

# Line 40 | Line 40 | cmdline_parser_print_help (void)
40    printf("  -i, --input=filename  input dump file\n");
41    printf("  -o, --output=STRING   output file prefix  (default=`hydro')\n");
42    printf("      --model=STRING    hydrodynamics model (support RoughShell and BeadModel)\n");
43 +  printf("  -b, --beads           generate the beads only, hydrodynamics will be \n                          performed  (default=off)\n");
44   }
45  
46  
# Line 68 | Line 69 | cmdline_parser (int argc, char * const *argv, struct g
69    args_info->input_given = 0 ;
70    args_info->output_given = 0 ;
71    args_info->model_given = 0 ;
72 +  args_info->beads_given = 0 ;
73   #define clear_args() { \
74    args_info->input_arg = NULL; \
75    args_info->output_arg = gengetopt_strdup("hydro") ;\
76    args_info->model_arg = NULL; \
77 +  args_info->beads_flag = 0;\
78   }
79  
80    clear_args();
# Line 92 | Line 95 | cmdline_parser (int argc, char * const *argv, struct g
95          { "input",      1, NULL, 'i' },
96          { "output",     1, NULL, 'o' },
97          { "model",      1, NULL, 0 },
98 +        { "beads",      0, NULL, 'b' },
99          { NULL, 0, NULL, 0 }
100        };
101  
102        stop_char = 0;
103 <      c = getopt_long (argc, argv, "hVi:o:", long_options, &option_index);
103 >      c = getopt_long (argc, argv, "hVi:o:b", long_options, &option_index);
104  
105        if (c == -1) break;       /* Exit from `while (1)' loop.  */
106  
# Line 136 | Line 140 | cmdline_parser (int argc, char * const *argv, struct g
140            args_info->output_arg = gengetopt_strdup (optarg);
141            break;
142  
143 +        case 'b':       /* generate the beads only, hydrodynamics will be performed.  */
144 +          if (args_info->beads_given)
145 +            {
146 +              fprintf (stderr, "%s: `--beads' (`-b') option given more than once\n", CMDLINE_PARSER_PACKAGE);
147 +              clear_args ();
148 +              exit (EXIT_FAILURE);
149 +            }
150 +          args_info->beads_given = 1;
151 +          args_info->beads_flag = !(args_info->beads_flag);
152 +          break;
153  
154 +
155          case 0: /* Long option with no short option */
156            /* hydrodynamics model (support RoughShell and BeadModel).  */
157            if (strcmp (long_options[option_index].name, "model") == 0)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines