Actual source code: ex19.c

petsc-3.6.1 2015-08-06
Report Typos and Errors
  2: static char help[] = "Tests string options with spaces";

  4: #include <petscsys.h>

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

 15:   PetscInitialize(&argc,&argv,"${PETSC_DIR}/src/sys/examples/tests/ex19options",help);
 16:   PetscOptionsGetInt(0,"-option1",&option1,&flg);
 17:   PetscOptionsGetString(0,"-option2",option2,20,&flg);
 18:   PetscPrintf(PETSC_COMM_WORLD,"%s\n",option2);
 19:   PetscOptionsGetString(0,"-option3",option3,30,&flg);
 20:   PetscPrintf(PETSC_COMM_WORLD,"%s\n",option3);
 21:   PetscFinalize();
 22:   return 0;
 23: }