Actual source code: ex19.c


  2: static char help[] = "Tests string options with spaces";

  4: #include <petscsys.h>

  6: int main(int argc, char **argv)
  7: {
  8:   char      option2[20], option3[30];
  9:   PetscBool flg;
 10:   PetscInt  option1;

 13:   PetscInitialize(&argc, &argv, "ex19options", help);
 14:   PetscOptionsGetInt(NULL, 0, "-option1", &option1, &flg);
 15:   PetscOptionsGetString(NULL, 0, "-option2", option2, sizeof(option2), &flg);
 16:   PetscPrintf(PETSC_COMM_WORLD, "%s\n", option2);
 17:   PetscOptionsGetString(NULL, 0, "-option3", option3, sizeof(option3), &flg);
 18:   PetscPrintf(PETSC_COMM_WORLD, "%s\n", option3);
 19:   PetscFinalize();
 20:   return 0;
 21: }

 23: /*TEST

 25:    test:
 26:      localrunfiles: ex19options

 28: TEST*/