diff --git a/fish/bin/fish_method_missing b/fish/bin/fish_method_missing new file mode 100755 index 0000000..7379640 --- /dev/null +++ b/fish/bin/fish_method_missing @@ -0,0 +1,12 @@ +#!/usr/bin/env ruby + +command = ARGV.shift + +case command +when /^git(@|:\/\/).*\.git$/ + system("git clone #{command.inspect}") +when /^(?:ftp|https?):\/\/.+\.t(?:ar\.)?gz$/ + system("curl #{command.inspect} | tar xzv") +else + $stderr.puts "No default action defined in #{__FILE__.inspect}" +end \ No newline at end of file diff --git a/fish/functions/method_missing.fish b/fish/functions/method_missing.fish new file mode 100644 index 0000000..d440e8f --- /dev/null +++ b/fish/functions/method_missing.fish @@ -0,0 +1,3 @@ +function method_missing --on-event fish_command_not_found + fish_method_missing $argv +end