Sha256: 8636966c1f7916a99a4fefaf760bc13afc09a2df1e3ad15ade7560c0ed03a0e9

Contents?: true

Size: 663 Bytes

Versions: 1

Compression:

Stored size: 663 Bytes

Contents

#!/usr/bin/env ruby
require 'pathname'

floom_command      = Pathname(__FILE__).realpath
command_dir        = floom_command.dirname
available_commands = Pathname.glob(command_dir.join('*')).reject{ |cmd| cmd.fnmatch? floom_command.to_s }.map(&:basename).map(&:to_s)
printable_commands = available_commands.map{ |cmd| "\t" + cmd.to_s }.join("\n")
command_name       = ARGV.shift
help_string        = <<HELP
Usage: floom <command> [options]

Available Commands:
    #{printable_commands}

Use floom <command> --help for specific options
HELP

if available_commands.include? command_name
  exec command_dir.join(command_name).to_s, *ARGV
else
  puts help_string
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
floom-0.0.1 bin/floom