Also read from STDIN on arguments input if STDIN not connected to tty.  Cleaned up the code.
Also read from STDIN on arguments input if STDIN not connected to tty.  Cleaned up the code.

princeofdarkness76/sial.org-scripts,princeofdarkness76/sial.org-scripts,thrig/scripts,thrig/scripts,princeofdarkness76/sial.org-scripts,thrig/scripts,princeofdarkness76/sial.org-scripts,thrig/scripts,thrig/scripts,thrig/scripts,princeofdarkness76/sial.org-scripts