Migrate CLI argument handling back to main.py
#1901
+562
−565
Merged
main.py
#1901