plug task enqueing properly
This commit is contained in:
@@ -72,10 +72,24 @@ def cmd_from_schema(args):
|
||||
print("that exports DATACLASSES and ENUMS lists.", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
print(f"Loading schema: {schema_path}")
|
||||
schema = load_schema(schema_path)
|
||||
# Parse include groups
|
||||
include = None
|
||||
if args.include:
|
||||
include = {g.strip() for g in args.include.split(",")}
|
||||
|
||||
print(f"Found {len(schema.models)} models, {len(schema.enums)} enums")
|
||||
print(f"Loading schema: {schema_path}")
|
||||
schema = load_schema(schema_path, include=include)
|
||||
|
||||
loaded = []
|
||||
if schema.models:
|
||||
loaded.append(f"{len(schema.models)} models")
|
||||
if schema.enums:
|
||||
loaded.append(f"{len(schema.enums)} enums")
|
||||
if schema.api_models:
|
||||
loaded.append(f"{len(schema.api_models)} api models")
|
||||
if schema.grpc_messages:
|
||||
loaded.append(f"{len(schema.grpc_messages)} grpc messages")
|
||||
print(f"Found {', '.join(loaded)}")
|
||||
|
||||
# Parse targets
|
||||
targets = [t.strip() for t in args.targets.split(",")]
|
||||
@@ -237,6 +251,12 @@ def main():
|
||||
default="pydantic",
|
||||
help=f"Comma-separated output targets ({formats_str})",
|
||||
)
|
||||
schema_parser.add_argument(
|
||||
"--include",
|
||||
type=str,
|
||||
default=None,
|
||||
help="Comma-separated model groups to include (dataclasses,enums,api,grpc). Default: all.",
|
||||
)
|
||||
schema_parser.set_defaults(func=cmd_from_schema)
|
||||
|
||||
# extract command
|
||||
|
||||
Reference in New Issue
Block a user