summaryrefslogtreecommitdiff
path: root/lib/rdoc/ri/ri_options.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/ri/ri_options.rb')
-rw-r--r--lib/rdoc/ri/ri_options.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/rdoc/ri/ri_options.rb b/lib/rdoc/ri/ri_options.rb
index ba420344f3..f59cdeda1c 100644
--- a/lib/rdoc/ri/ri_options.rb
+++ b/lib/rdoc/ri/ri_options.rb
@@ -208,7 +208,13 @@ module RI
when "--list-names" then @list_names = true
when "--no-pager" then @use_stdout = true
when "--classes" then @list_classes = true
- when "--doc-dir" then @doc_dir = arg
+ when "--doc-dir"
+ if File.directory?(arg)
+ @doc_dir = arg
+ else
+ $stderr.puts "Invalid directory: #{arg}"
+ exit 1
+ end
when "--format"
@formatter = RI::TextFormatter.for(arg)