# PetscGetArgs
Allows you to access the raw command line arguments anywhere after PetscInitialize() is called but before `PetscFinalize()`. 
## Synopsis
```
#include "petscsys.h"   
PetscErrorCode PetscGetArgs(int *argc, char ***args)
```
Not Collective


## Output Parameters

- ***argc -*** count of number of command line arguments
- ***args -*** the command line arguments





## Notes
This is usually used to pass the command line arguments into other libraries
that are called internally deep in PETSc or the application.

The first argument contains the program name as is normal for C arguments.


## See Also
 `PetscFinalize()`, `PetscInitializeFortran()`, `PetscGetArguments()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/objects/pinit.c.html#PetscGetArgs">src/sys/objects/pinit.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/objects/pinit.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
