"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do."
-- unsure; often attributed without source to information philosopher Ted Nelson
(TO DO: command line vs. screen vs. GUI, readline, ncurses, GTK+/GDK/GNOME, etc.;)
If the program can accept a single input stream, then by default it should read input from stdin. If ordinary arguments (that is, not starting with a dash) are specified on the command line, they should be the input file(s) instead of stdin.
If the program creates a single output stream, then by default it should write to stdout. A command-line option ("-o" and/or "--output") should be available to specify an output file to be used instead of stdout.
TO DO: buffer overflows, shell characters, input validation, etc. temp files in world-writable directories: fd = open(filename, O_WRONLY | O_CREAT | O_EXCL, 0600); or libiberty's "mkstemps"
(TO DO)