INNER CODE UNIT · Python

main

dummylabs/thewatchman · cli/parser.py:65

def main():
    parser = argparse.ArgumentParser(description="Watchman Prototype Parser (CLI)")
    # list of paths divided by space
    parser.add_argument("path", nargs='?', default=None, help="Root path to scan (default: current dir)")
    # -ignore "*.log" --ignore "*.tmp"
    parser.add_argument("--ignore", action='append', help="Glob patterns to ignore")
    parser.add_argument("--force", action='store_true', help="Force rescan of all files")
    parser.add_argument("--db-path", default="watchman.db", help="Path to SQLite database")
    parser.add_argument("--dump-db", help="Dump content of the provided SQLite database without scanning. Conflicting args: path, --force, --ignore")
    parser.add_argument("--no-files", action='store_true', help="Hide the list of processed files")
    parser.add_argument("--no-items", action='store_true', help="Hide the list of found items")
    parser.add_argument("--stable-output", action='store_true', help="Exclude changing data (ID, Scan Date) from output for regression testing")
    parser.add_argument("--debug", action='store_true', help="Enable debug logging to debug.log")

    if len(sys.argv) == 1 and sys.stdin.isatty():
        # Only print help if no args and interactive, but here we have defaults so maybe not?
        # The original code exited if len(sys.argv) == 1.
        # If I have a default arg, len(sys.argv) is 1 if I run without args.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…