-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathno-manifest.py
More file actions
34 lines (28 loc) · 1.12 KB
/
Copy pathno-manifest.py
File metadata and controls
34 lines (28 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python3
"""no-manifest.py — pure argparse, no manifest.
This script tests the introspection feature (M7): PyShell should
generate a form by monkey-patching argparse.parse_args.
"""
import argparse
import sys
def main():
parser = argparse.ArgumentParser(description="Check links in a file")
parser.add_argument("input_file", type=str, help="File to process")
parser.add_argument("-o", "--output", type=str, default="output.txt", help="Output file")
parser.add_argument("-v", "--verbose", action="store_true", help="Verbose output")
parser.add_argument("-n", "--count", type=int, default=10, help="Number of items")
parser.add_argument(
"--mode",
choices=["fast", "slow", "turbo"],
default="fast",
help="Processing mode",
)
args = parser.parse_args()
print(f"Input: {args.input_file}", flush=True)
print(f"Output: {args.output}", flush=True)
print(f"Verbose: {args.verbose}", flush=True)
print(f"Count: {args.count}", flush=True)
print(f"Mode: {args.mode}", flush=True)
print("Done!", flush=True)
if __name__ == "__main__":
main()