require 'nehm/tracks_view_command'

module Nehm

  ##
  # This command gets likes/posts from user's account,
  # Prints as menu, and downloads selected tracks

  class SelectCommand < TracksViewCommand

    def initialize
      super

      add_option(:from, 'from PERMALINK',
                 'Select track(s) from user with PERMALINK')
    end

    def arguments
      { 'likes' => 'Select likes',
        'posts' => 'Select posts' }
    end

    def program_name
      'nehm select'
    end

    def execute
      @type = @options[:args].shift
      super
    end

    def summary
      'Get likes or posts from your account, nicely print them and download selected tracks'
    end

    def usage
    end

    protected

    def get_tracks
      case @type
      when /l/
        @track_manager.likes(@limit, @offset)
      when /p/
        @track_manager.posts(@limit, @offset)
      when nil
        UI.term 'You must provide an argument'
      else
        UI.term "Invalid argument/option '#{type}'"
      end
    end

  end
end

require 'nehm/tracks_view_command'

module Nehm

  ##
  # This command gets likes/posts from user's account,
  # Prints as menu, and downloads selected tracks

  class SelectCommand < TracksViewCommand

    def initialize
      super

      add_option(:from, 'from PERMALINK',
                 'Select track(s) from user with PERMALINK')
    end

    def arguments
      { 'likes' => 'Select likes',
        'posts' => 'Select posts' }
    end

    def program_name
      'nehm select'
    end

    def execute
      @type = @options[:args].shift
      super
    end

    def summary
      'Get likes or posts from your account, nicely print them and download selected tracks'
    end

    def usage
      "#{program_name} ARGUMENT [OPTIONS]"
    end

    protected

    def get_tracks
      case @type
      when /l/
        @track_manager.likes(@limit, @offset)
      when /p/
        @track_manager.posts(@limit, @offset)
      when nil
        UI.term 'You must provide an argument'
      else
        UI.term "Invalid argument/option '#{type}'"
      end
    end

  end
end

Add usage to 'select' command
Add usage to 'select' command
