21 lines
585 B
Ruby
Executable File
21 lines
585 B
Ruby
Executable File
#!/usr/bin/env ruby
|
|
# frozen_string_literal: true
|
|
|
|
# rdb -- every /rdb command is this one program, looking at the name it was
|
|
# called by. `row`, `column`, `total` ... are symlinks to it (`rdb install`).
|
|
|
|
require_relative '../lib/rdb'
|
|
|
|
name = File.basename($PROGRAM_NAME)
|
|
args = ARGV.dup
|
|
Signal.trap('PIPE', 'SYSTEM_DEFAULT')
|
|
if name == 'rdb'
|
|
case args.first
|
|
when nil, '-h', '--help' then name = 'rdb.list'
|
|
when '-v', '--version' then puts "rdb #{Rdb::VERSION}"; exit
|
|
when 'install' then name = 'rdb.install'; args.shift
|
|
else name = args.shift
|
|
end
|
|
end
|
|
Rdb.run(name, args)
|