File: //snap/google-cloud-cli/394/help/man/man1/gcloud_beta_topic_flags-file.1
.TH "GCLOUD_BETA_TOPIC_FLAGS\-FILE" 1
.SH "NAME"
.HP
gcloud beta topic flags\-file \- \-\-flags\-file=YAML_FILE supplementary help
.SH "DESCRIPTION"
\fB(BETA)\fR The \fB\-\-flags\-file\fR=\fIYAML\-FILE\fR flag, available to all
\fBgcloud\fR commands, supports complex flag values in any command interpreter.
Complex flag values that contain command interpreter special characters may be
difficult to specify on the command line. The combined list of \fIspecial\fR
characters across commonly used command interpreters (shell, cmd.exe,
PowerShell) is surprisingly large. Among them are \f5", ', `, *, ?, [, ], (, ),
$, %, #, ^, &, |, {, }, ;, \e, <, >,\fR \fIspace\fR, \fItab\fR, \fInewline\fR.
Add to that the separator characters for \fBlist\fR and \fBdict\fR valued flags,
and it becomes all but impossible to construct portable command lines.
The \fB\-\-flags\-file\fR=\fIYAML\-FILE\fR flag solves this problem by allowing
command line flags to be specified in a YAML/JSON file. String, numeric, list
and dict flag values are specified using YAML/JSON notation and quoting rules.
Flag specification uses dictionary notation. Use a list of dictionaries for
flags that must be specified multiple times.
For example, this YAML file defines values for Boolean, integer, floating point,
string, dictionary and list valued flags:
.RS 2m
\-\-boolean:
\-\-integer: 123
\-\-float: 456.789
\-\-string: A string value.
\-\-dictionary:
a=b: c,d
e,f: g=h
i: none
j=k=l: m=$n,o=%p
"y:": ":z"
meta:
\- key: foo
value: bar
\- key: abc
value: xyz
\-\-list:
\- a,b,c
\- x,y,z
.RE
If the file is named \fBmy\-flags.yaml\fR then the command line flag
\fB\-\-flags\-file=my\-flags.yaml\fR will set the specified flags on any system
using any command interpreter. \fB\-\-flags\-file\fR may be specified in a YAML
file, and its value can be a YAML list to reference multiple files.
This example specifies the \fB\-\-metadata\fR flag multiple times:
.RS 2m
\- \-\-metadata: abc
\-\-integer: 123
\- \-\-metadata: xyz
.RE
Each \fB\-\-flags\-file\fR arg is replaced by its contents, so normal flag
precedence applies. For example, given \fBflags\-1.yaml\fR:
.RS 2m
\-\-zone: us\-east2\-a
.RE
\fBflags\-2.yaml\fR:
.RS 2m
\-\-verbosity: info
\-\-zone: us\-central1\-a
.RE
and command line:
.RS 2m
gcloud compute instances describe \e
\-\-flags\-file=flags\-1.yaml my\-instance \-\-flags\-file=flags\-2.yaml
.RE
the effective command line is:
.RS 2m
gcloud compute instances describe \e
\-\-zone=us\-east2\-a my\-instance \-\-verbosity=info \-\-zone=us\-central1\-a
.RE
using zone \fBus\-central1\-a\fR (not \fBus\-east2\-a\fR, because
\f5flags\-2.yaml\fR, to the right of \f5flags\-1.yaml\fR, has higher
precedence).
.SH "NOTES"
This command is currently in beta and might change without notice. These
variants are also available:
.RS 2m
$ gcloud topic flags\-file
.RE
.RS 2m
$ gcloud alpha topic flags\-file
.RE