Module: GrooveDl::CLI
- Defined in:
- lib/groove-dl/cli.rb
Overview
CLI module
Constant Summary collapse
- SLOP_OPTIONS =
Hash containing the default Slop options.
{ strict: true, help: true, banner: 'Usage: groove-dl [COMMAND] [OPTIONS]' }
Class Method Summary collapse
- .default_options ⇒ Slop
- .options ⇒ Slop
-
.version_information ⇒ String
Returns a String containing some platform/version related information.
Class Method Details
.default_options ⇒ Slop
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/groove-dl/cli.rb', line 26 def self. Slop.new(SLOP_OPTIONS.dup) do separator "\nOptions:\n" on :v, :version, 'Shows the current version' do puts CLI.version_information end on :p=, :playlist=, 'Playlist', as: Integer on :s=, :song=, 'Song', as: Integer on :o=, :output=, 'Output directory', as: String run do |opts| next if opts[:v] client = Grooveshark::Client.new d = Downloader.new(client, opts) d.playlist(opts[:p]) if opts[:p] d.song(opts[:s]) if opts[:s] end end end |
.options ⇒ Slop
19 20 21 |
# File 'lib/groove-dl/cli.rb', line 19 def self. ||= end |
.version_information ⇒ String
Returns a String containing some platform/version related information.
54 55 56 |
# File 'lib/groove-dl/cli.rb', line 54 def self.version_information "Groove-dl v#{VERSION} on #{RUBY_DESCRIPTION}" end |