MCPcopy Create free account
hub / github.com/apache/fory / cmd_scan_generated

Function cmd_scan_generated

compiler/fory_compiler/cli.py:1083–1101  ·  view source on GitHub ↗

Handle the scan-generated command.

(args: argparse.Namespace)

Source from the content-addressed store, hash-verified

1081
1082
1083def cmd_scan_generated(args: argparse.Namespace) -> int:
1084 """Handle the scan-generated command."""
1085 root = args.root.resolve()
1086 if not root.exists():
1087 print(f"Error: Root not found: {root}", file=sys.stderr)
1088 return 1
1089 if not root.is_dir():
1090 print(f"Error: Root is not a directory: {root}", file=sys.stderr)
1091 return 1
1092
1093 generated_files = scan_generated_files(root, args.relative)
1094 if args.delete:
1095 for file_path in generated_files:
1096 try:
1097 file_path.unlink()
1098 except OSError as e:
1099 print(f"Error deleting {file_path}: {e}", file=sys.stderr)
1100 return 1
1101 return 0
1102
1103
1104def main(args: Optional[List[str]] = None) -> int:

Callers 1

mainFunction · 0.85

Calls 1

scan_generated_filesFunction · 0.85

Tested by

no test coverage detected