Add status structable macros for alternative field
Some resources uses `state` or `operating_status` as a sort of `status` property. Set `status` StructTable marcros for such fields so that output coloring use those fields. Change-Id: I1c1faa0f69e1d22b6230db2df90a981ca496e643
This commit is contained in:
1 changed files with 11 additions and 0 deletions
@@ -34,6 +34,7 @@ BASIC_FIELDS = [
"uuid",
"state",
"status",
"operating_status",
]
@@ -276,6 +277,16 @@ class StructFieldResponse(common_rust.StructField):
# there is at least "id" field existing in the struct OR the
# field is not in the first 10
macros.add("wide")
if (
self.local_name == "state"
and "status" not in struct.fields.keys()
):
macros.add("status")
elif (
self.local_name == "operating_status"
and "status" not in struct.fields.keys()
):
macros.add("status")
if self.data_type.type_hint in [
"Value",
"Option<Value>",
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.