Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #626 from AndrejMitrovic/CArgsDocs
Browse files Browse the repository at this point in the history
Add example code to cArgs.
  • Loading branch information
Alex Rønne Petersen committed Oct 6, 2013
2 parents 8db8662 + 48af55d commit 3753bee
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/core/runtime.d
Expand Up @@ -150,11 +150,25 @@ struct Runtime
}

/**
* Returns the unprocessed C arguments supplied when the process was
* started. Use this when you need to supply argc and argv to C libraries.
* Returns the unprocessed C arguments supplied when the process was started.
* Use this when you need to supply argc and argv to C libraries.
*
* Returns:
* A $(LREF CArgs) struct with the arguments supplied when this process was started.
*
* Example:
* ---
* import core.runtime;
*
* // A C library function requiring char** arguments
* extern(C) void initLibFoo(int argc, char** argv);
*
* void main()
* {
* auto args = Runtime.cArgs;
* initLibFoo(args.argc, args.argv);
* }
* ---
*/
static @property CArgs cArgs()
{
Expand Down

0 comments on commit 3753bee

Please sign in to comment.