summaryrefslogtreecommitdiff
path: root/lib/shell/command-processor.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/shell/command-processor.rb')
-rw-r--r--lib/shell/command-processor.rb15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/shell/command-processor.rb b/lib/shell/command-processor.rb
index 2239ca98f6..82af76dd5e 100644
--- a/lib/shell/command-processor.rb
+++ b/lib/shell/command-processor.rb
@@ -11,12 +11,11 @@
#
require "e2mmap"
-require "thread"
-require "shell/error"
-require "shell/filter"
-require "shell/system-command"
-require "shell/builtin-command"
+require_relative "error"
+require_relative "filter"
+require_relative "system-command"
+require_relative "builtin-command"
class Shell
# In order to execute a command on your OS, you need to define it as a
@@ -54,8 +53,9 @@ class Shell
# include run file.
#
def self.run_config
+ rc = "~/.rb_shell"
begin
- load File.expand_path("~/.rb_shell") if ENV.key?("HOME")
+ load File.expand_path(rc) if ENV.key?("HOME")
rescue LoadError, Errno::ENOENT
rescue
print "load error: #{rc}\n"
@@ -180,6 +180,9 @@ class Shell
top_level_test(command, file1)
end
else
+ unless FileTest.methods(false).include?(command.to_sym)
+ raise "unsupported command: #{ command }"
+ end
if file2
FileTest.send(command, file1, file2)
else