File: arg_printer.py

package info (click to toggle)
cmd2 3.2.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,664 kB
  • sloc: python: 17,488; makefile: 114; sh: 39; javascript: 7
file content (7 lines) | stat: -rwxr-xr-x 236 bytes parent folder | download
1
2
3
4
5
6
7
#!/usr/bin/env python
import os
import sys

print(f"Running Python script {os.path.basename(sys.argv[0])!r} which was called with {len(sys.argv) - 1} arguments")
for i, arg in enumerate(sys.argv[1:]):
    print(f"arg {i + 1}: {arg!r}")