subroutine print_help() print '(a)', 'Usage: fortrun [options] <file>' print '(a)', '' print '(a)', 'Run a Fortran program file with automatic dependency resolution.' print '(a)', '' print '(a)', 'Arguments:' print '(a)', ' <file> Path to Fortran source file' print '(a)', ' .f90/.F90 = Standard Fortran (no preprocessing)' print '(a)', ' .lf/.LF = Lowercase Fortran (frontend with type inference)' print '(a)', '' print '(a)', 'Options:' print '(a)', ' -h, --help Show this help message' print '(a)', ' -v, --verbose 1 Show FPM output' print '(a)', ' -vv, --verbose 2 Show detailed FPM output' print '(a)', ' -j, --jobs N (Reserved for future use)' print '(a)', ' --cache-dir DIR Use custom cache directory' print '(a)', ' --config-dir DIR Use custom config directory' print '(a)', ' --flag FLAGS Pass custom flags to FPM compiler' print '(a)', ' (.f90: user flags only, .lf: opinionated + user flags)' print '(a)', ' --no-wait Fail immediately if cache is locked' print '(a)', ' --standardize Output standardized (.lf files to F90) to STDOUT' print '(a)', ' --emit-f90 Synonym for --standardize' print '(a)', ' --emit-hlfir Emit HLFIR (High-Level Fortran IR) to STDOUT' print '(a)', ' --emit-fir Emit FIR (Fortran IR, lowered from HLFIR) to STDOUT' print '(a)', ' --emit-llvm Emit LLVM IR (lowered from FIR) to STDOUT' print '(a)', ' --compile Compile to object code via full MLIR pipeline' print '(a)', ' --enable-ad Enable automatic differentiation with Enzyme' print '(a)', ' -o, --output FILE Output file for --compile/--emit-* modes' print '(a)', '' print '(a)', 'Cache Management:' print '(a)', ' --clear-cache Clear all cached files' print '(a)', ' --cache-info Show cache statistics' print '(a)', '' print '(a)', 'Notebook Mode:' print '(a)', ' --notebook Run as notebook with cells and output capture' print '(a)', ' -o, --output FILE Output markdown file (default: <input>.md)' print '(a)', '' print '(a)', 'JSON Pipeline Input:' print '(a)', ' --from-tokens Read tokens from JSON file (skip lexing)' print '(a)', ' --from-ast Read AST from JSON file (skip lexing + parsing)' print '(a)', ' --from-semantic Read semantic AST from JSON file (skip to codegen)' print '(a)', '' print '(a)', 'Debug Output (JSON):' print '(a)', ' --debug-tokens Output tokens as JSON' print '(a)', ' --debug-ast Output AST as JSON' print '(a)', ' --debug-semantic Output semantic analysis as JSON' print '(a)', ' --debug-codegen Output generated code as JSON' print '(a)', '' print '(a)', 'Environment:' print '(a)', ' OMP_NUM_THREADS Number of parallel build threads (FPM uses OpenMP)' end subroutine print_help