Skip to content

Commit fd523af

Browse files
committed
Add version argument to CLI and enhance logging for proxy startup
1 parent 23aab6f commit fd523af

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/omproxy/cli.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ def main():
1515
parser = argparse.ArgumentParser(
1616
description="Bidirectional proxy for subprocess communication"
1717
)
18+
parser.add_argument(
19+
"--version", action="version", version=__version__, help="Show version and exit"
20+
)
1821
parser.add_argument(
1922
"-v", "--verbose", action="store_true", help="Enable debug logging"
2023
)
@@ -36,11 +39,16 @@ def main():
3639
)
3740
logging.basicConfig(level=logging.DEBUG if args.verbose else logging.INFO)
3841

39-
logfire.info("starting_proxy", command=args.command)
40-
4142
# Combine command and args when running the proxy
4243
full_command = [args.command] + args.args
4344

45+
logfire.info(
46+
"starting_proxy",
47+
command=args.command,
48+
args=args.args,
49+
full_command=full_command,
50+
)
51+
4452
async def run_proxy():
4553
async with Proxy(
4654
lambda line: logfire.info("on_stdin_cb", line=line),

0 commit comments

Comments
 (0)