Skip to content

Commit 3180210

Browse files
tswastlesv
authored andcommitted
Document recommendations for command-line parsing. (GoogleCloudPlatform#602)
1 parent 7085b51 commit 3180210

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

CONTRIBUTING.md

+10
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,14 @@ uses the common Checkstyle configuration.
125125

126126
This is just used for testing. The sample should build without a parent defined.
127127

128+
### Parsing Command-Line Arguments in Samples
129+
130+
Simple command-line samples with only positional arguments should use the
131+
`args` argument to `main(String... args)` directly. A command-line sample
132+
which has optional parameters should use the [Apache Commons
133+
CLI](https://commons.apache.org/proper/commons-cli/index.html) library.
134+
135+
Dataflow samples are an exception to this rule, since Dataflow has [its own
136+
method for setting custom
137+
options](https://cloud.google.com/dataflow/pipelines/specifying-exec-params)
128138

0 commit comments

Comments
 (0)