1 2 static char help[] = "Tests string options with spaces"; 3 4 #include <petscsys.h> 5 6 int main(int argc,char **argv) 7 { 8 char option2[20],option3[30]; 9 PetscBool flg; 10 PetscInt option1; 11 12 PetscFunctionBeginUser; 13 PetscCall(PetscInitialize(&argc,&argv,"ex19options",help)); 14 PetscCall(PetscOptionsGetInt(NULL,0,"-option1",&option1,&flg)); 15 PetscCall(PetscOptionsGetString(NULL,0,"-option2",option2,sizeof(option2),&flg)); 16 PetscCall(PetscPrintf(PETSC_COMM_WORLD,"%s\n",option2)); 17 PetscCall(PetscOptionsGetString(NULL,0,"-option3",option3,sizeof(option3),&flg)); 18 PetscCall(PetscPrintf(PETSC_COMM_WORLD,"%s\n",option3)); 19 PetscCall(PetscFinalize()); 20 return 0; 21 } 22 23 /*TEST 24 25 test: 26 localrunfiles: ex19options 27 28 TEST*/ 29