clip
clip copied to clipboard
Example fails with missing files
When running the code given in README with the '-f' option and filenames that do not exist, we get incorrect error messages:
[doux] ~/temp: ./clipex.rb -f foo,bar
./clipex.rb -f foo,bar
Errors:
files: Missing required parameter: files
Usage:
-s --server The server name (default: localhost)
-p --port The port (default: 8080)
-f --files Files to send REQUIRED
-v --verbose Make it chatty
The error-checking in the block (which raises if the file can't be found) doesn't propagate out to the command-line. As an aside, when the "files" is marked as optional (instead of required) the correct behavior occurs:
[alex] ~: /tmp/foo.rb -f foo,bar
Errors:
files: unable to read file foo
Usage:
-s --server The server name (default: localhost)
-p --port The port (default: 8080)
-f --files Files to send
-v --verbose Make it chatty