/usr/bin/asciiart is in asciiart 0.0.9-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 | #!/usr/bin/ruby
require 'asciiart'
require 'optparse'
options = {}
invert_chars = false
opt_parser = OptionParser.new do |opts|
opts.banner = 'Usage: asciiart [options] <path_or_url>'
opts.on('-w', '--width WIDTH', 'Width of the finished Ascii Art (Default: 100)') do |width|
options[:width] = width.to_i
end
opts.on('-f', '--format [text/html]', 'output format (Default: text)') do |format|
options[:format] = format
end
opts.on('-c', '--color', 'Switch to use colored terminal output (Default: false)') do
options[:color] = true
end
opts.on('-i', '--invert-chars', 'Invert the character map. Depending on your terminal and image this can make the image clearer (or a lot worse)') do
invert_chars = true
end
opts.on_tail('-v', '--version', 'Show AsciiArt version') do
puts 'AsciiArt version ' + AsciiArt::VERSION
exit
end
opts.on_tail("-h", "--help", "Show this message") do
puts opts
exit
end
end
begin
opt_parser.parse!
rescue OptionParser::MissingArgument => e
puts "ERROR: #{e.message.capitalize}\n#{opt_parser}"
exit
end
if ARGV.length == 0
puts "ERROR: You must specify a path or URL to convert\n#{opt_parser}"
exit
end
art = AsciiArt.new(ARGV[0])
art.image_chars = art.image_chars.reverse if invert_chars
puts art.to_ascii_art(options)
|