xref: /petsc/src/sys/tests/ex19.c (revision b122ec5aa1bd4469eb4e0673542fb7de3f411254)
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   CHKERRQ(PetscInitialize(&argc,&argv,"ex19options",help));
13   CHKERRQ(PetscOptionsGetInt(NULL,0,"-option1",&option1,&flg));
14   CHKERRQ(PetscOptionsGetString(NULL,0,"-option2",option2,sizeof(option2),&flg));
15   CHKERRQ(PetscPrintf(PETSC_COMM_WORLD,"%s\n",option2));
16   CHKERRQ(PetscOptionsGetString(NULL,0,"-option3",option3,sizeof(option3),&flg));
17   CHKERRQ(PetscPrintf(PETSC_COMM_WORLD,"%s\n",option3));
18   CHKERRQ(PetscFinalize());
19   return 0;
20 }
21 
22 /*TEST
23 
24    test:
25      localrunfiles: ex19options
26 
27 TEST*/
28