Add setup config filed information.

- Provide the args information for config field names.
- Validate the args by config field names.

Bug: 157532869
Test: acloud-dev setup --help
      acloud-dev setup --update-config wrong_field val
Change-Id: Ia7495ff0875e3ff8f0f9eabc8387fe8248ef450f
diff --git a/setup/setup_args.py b/setup/setup_args.py
index 4190223..1e3583c 100644
--- a/setup/setup_args.py
+++ b/setup/setup_args.py
@@ -18,6 +18,13 @@
 Defines the setup arg parser that holds setup specific args.
 """
 
+from acloud import errors
+# pylint: disable=no-name-in-module,import-error
+from acloud.internal.proto.user_config_pb2 import UserConfig
+
+
+_FIELD_NAMES = sorted([field.name for field in UserConfig.DESCRIPTOR.fields])
+_CONFIG_FIELD = 0
 CMD_SETUP = "setup"
 
 
@@ -68,6 +75,26 @@
         required=False,
         help="Update the acloud user config. The first arg is field name in "
         "config, and the second arg is the value of the field. Command would "
-        "like: 'acloud setup --config stable_host_image_family acloud-release'")
+        "like: 'acloud setup --config stable_host_image_family acloud-release'."
+        " The first arg can be one of following fields:%s" % _FIELD_NAMES)
 
     return setup_parser
+
+
+def VerifyArgs(args):
+    """Verify args.
+
+    One example of command "acloud setup --update-config zone us-central1-c",
+    then this function would check "zone" is a valid field.
+
+    Args:
+        args: Namespace object from argparse.parse_args.
+
+    Raises:
+        errors.NotSupportedFieldName: The field name doesn't support in config.
+    """
+    if args.update_config:
+        if args.update_config[_CONFIG_FIELD] not in _FIELD_NAMES:
+            raise errors.NotSupportedFieldName(
+                "Field[%s] isn't in support list: %s" % (args.update_config[0],
+                                                         _FIELD_NAMES))