Skip to content

Instantly share code, notes, and snippets.

@geblanco
Created September 11, 2023 10:59
Show Gist options
  • Save geblanco/fcaf0a2d37f021cb04cce1c779cbd3f7 to your computer and use it in GitHub Desktop.
Save geblanco/fcaf0a2d37f021cb04cce1c779cbd3f7 to your computer and use it in GitHub Desktop.
Dump received arguments to json
#!/bin/python3
import sys
import json
data = sys.stdin.readlines()
args = []
for line in data:
line = line.replace("\\", "").strip().split(" ")
args.extend(line)
print(json.dumps(args, indent=2) + "\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment