Sha256: 4115c89e93042e1cdaaccf8ae576f492d39f5b7aff599a130a16d3f778a659e1

Contents?: true

Size: 1.09 KB

Versions: 1

Compression:

Stored size: 1.09 KB

Contents

#!/usr/bin/env ruby
# Wik - Quick and easy Wikipedia searches
# Daniel Ethridge

require "wik"
include Wik
require "wik/version"

# If there are no arguments, display a message to help you remember what the program does
if ARGV.length == 0
  puts "Try to tell me what you need...`wik wiki`"
  exit
end

help = """Wik is a quick and easy Wikipedia search tool for the command line, try it out:
hello, world!   -   Automatically handle everything
-s keyword      -   Search Wikipedia
-f topic        -   Find a list of available pages about a topic
-v api          -   View API
-d ruby         -   Get a short description of ruby
"""

# Argument "parser" if you want to call it that
case ARGV[0]
  when "--help", "-h"
    puts help
    exit
  when "--version", "-V"
    puts "Wik v#{VERSION}"
    exit
  when "--search", "-s"
    search(ARGV[1..-1].join(" "))
    exit
  when "--find", "-f"
    find(ARGV[1..-1].join(" "))
    exit
  when "--view", "-v"
    view(ARGV[1..-1].join(" "))
    exit
  when "--describe", "-d"
    describe(ARGV[1..-1].join(" "))
    exit
  else
    handle(ARGV[0..-1].join(" "))
    exit
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
wik-0.1.0 bin/wik