Sha256: dd03de013cd6731c76c3c12b5c7b1f5359b25eb2b600e94f7943029ee0426832

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

#!/usr/bin/env ruby
# DuckGo is a RubyGem library and command line tool for searching with DuckDuckGo.
# By default, it puts out only the relevant information, but when told, it will dump
# all the data you could ask for. This tool aims to give access to most of the
# features from the official API.
# Daniel Ethridge

require "duckgo"
include DuckGo
require "duckgo/version"

# If there are no arguments...
if ARGV.length == 0
  puts "Hmm..."
  exit
end

help = """DuckGo lets you search duckduckgo.com for instant answers

duckgo [--help | -h]         :  Display this help
duckgo [--version | -V]      :  Display version
duckgo something searchable  :  Auto-handle the search
duckgo \!gem duckgo          :  Use !bang syntax to search a specific site

View docs and API on https://github.com/wlib/duckgo
Made by Daniel Ethridge | git.io/de
"""

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
duckgo-1.1.0 bin/duckgo