Building Google Cloud Platform Solutions
上QQ阅读APP看书,第一时间看更新

Global flags

For all commands in the gcloud CLI, users can specify a number of global flags to modify command behavior. The --account, --project, and --configuration flags allow you to override the current defaults for your environment. These are useful to avoid modifying or switching configurations to run a few quick commands.  Other global flags including --quiet, --flatten, --format, and --verbosity allow users to modify the output from running commands—often useful when running scripts or debugging operations.

A great way to see how gcloud performs various actions is to use the --log-http global flag. For instance, running gcloud compute instances list --log-http shows that gcloud first fetches all known regions, then all known zones for those regions, and finally fetches all Google Compute Engine ( GCE) instances for each zone.

At any time, users can append --help to a command to bring up that command's documentation. This is true for the root gcloud, command groups, and all subcommands and operations. In addition, users can learn about CLI-wide concepts using the gcloud topic command group. The list of available topics can be seen by running gcloud topic --help. For example, to learn about using the --filter flag available in all list-producing operations, you can run gcloud topic filter.