Change parameter specification -- default to command line string; use '-f' (or --file) to specify a file; don't use standard input for parameters.
Correctly check range of a segment.