1c4762a1bSJed Brown 2c4762a1bSJed Brown static char help[] = "Tests string options with spaces"; 3c4762a1bSJed Brown 4c4762a1bSJed Brown #include <petscsys.h> 5c4762a1bSJed Brown 6*d71ae5a4SJacob Faibussowitsch int main(int argc, char **argv) 7*d71ae5a4SJacob Faibussowitsch { 8c4762a1bSJed Brown char option2[20], option3[30]; 9c4762a1bSJed Brown PetscBool flg; 10c4762a1bSJed Brown PetscInt option1; 11c4762a1bSJed Brown 12327415f7SBarry Smith PetscFunctionBeginUser; 139566063dSJacob Faibussowitsch PetscCall(PetscInitialize(&argc, &argv, "ex19options", help)); 149566063dSJacob Faibussowitsch PetscCall(PetscOptionsGetInt(NULL, 0, "-option1", &option1, &flg)); 159566063dSJacob Faibussowitsch PetscCall(PetscOptionsGetString(NULL, 0, "-option2", option2, sizeof(option2), &flg)); 169566063dSJacob Faibussowitsch PetscCall(PetscPrintf(PETSC_COMM_WORLD, "%s\n", option2)); 179566063dSJacob Faibussowitsch PetscCall(PetscOptionsGetString(NULL, 0, "-option3", option3, sizeof(option3), &flg)); 189566063dSJacob Faibussowitsch PetscCall(PetscPrintf(PETSC_COMM_WORLD, "%s\n", option3)); 199566063dSJacob Faibussowitsch PetscCall(PetscFinalize()); 20b122ec5aSJacob Faibussowitsch return 0; 21c4762a1bSJed Brown } 22c4762a1bSJed Brown 23c4762a1bSJed Brown /*TEST 24c4762a1bSJed Brown 25c4762a1bSJed Brown test: 26c4762a1bSJed Brown localrunfiles: ex19options 27c4762a1bSJed Brown 28c4762a1bSJed Brown TEST*/ 29