/usr/bin/rabbit-command is in rabbit 2.1.3-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | #!/usr/bin/ruby
# -*- ruby -*-
require 'drb/drb'
require "rabbit/console"
include Rabbit::GetText
def parse(args=ARGV, logger=nil)
Rabbit::Console.parse!(args, logger) do |parser, options|
options.rabbit_uri = options.druby_uri
options.commands = []
parser.separator ""
parser.on("--rabbit-uri=URI",
_("Specify Rabbit's dRuby URI as [URI]."),
"(#{options.rabbit_uri})") do |uri|
options.rabbit_uri = uri
end
parser.separator(_("Move commands"))
parser.on("--previous", _("Move to previous")) do
options.commands << [false, :move_to_previous_if_can]
end
parser.on("--next", _("Move to next")) do
options.commands << [false, :move_to_next_if_can]
end
parser.on("--previous-slide", _("Move to the previous slide")) do
options.commands << [false, :move_to_previous_slide_if_can]
end
parser.on("--next-slide", _("Move to the next slide")) do
options.commands << [false, :move_to_next_slide_if_can]
end
parser.on("--first-slide", _("Move to the first slide")) do
options.commands << [false, :move_to_first]
end
parser.on("--last-slide", _("Move to the last slide")) do
options.commands << [false, :move_to_last]
end
parser.on("--jump-to=N", Integer, _("Move to the Nth slide")) do |n|
options.commands << [false, :move_to_if_can, n]
end
parser.separator(_("Get commands"))
parser.on("--source", _("Show source")) do
options.commands << [:puts, :source]
end
parser.on("--current-slide-rd", _("Show the current slide source as RD")) do
options.commands << [:puts, :current_slide_rd]
end
parser.separator(_("Control commands"))
parser.on("--toggle-fullscreen", _("Toggle fullscreen")) do
options.commands << [false, :toggle_fullscreen]
end
parser.on("--toggle-index-mode", _("Toggle index mode")) do
options.commands << [false, :toggle_index_mode]
end
parser.on("--toggle-whiteout", _("Toggle whiteout")) do
options.commands << [false, :toggle_whiteout]
end
parser.on("--toggle-blackout", _("Toggle blackout")) do
options.commands << [false, :toggle_blackout]
end
parser.on("--quit", _("Quit")) do
options.commands << [false, :quit]
end
end
end
def main
options, logger = parse
rabbit = DRbObject.new_with_uri(options.rabbit_uri)
options.commands.each do |output, method, *args|
result = rabbit.send(method, *args)
send(output, result) if output
end
end
main
|