#! /usr/bin/env python3
# -*- coding: utf-8 -*-
# vim:fenc=utf-8:ft=python
#
# Bad Witch
# Copyright © 2020 Vintage Salt <rehashedsalt@cock.li>
#
# Distributed under terms of the MIT license.
#

import argparse
import sys

class Library:
    # A big thing full of songs
    def __init__(self):
        return

class Song:
    # An item with metadata and a source
    def __init__(self, title, source):
        self.title = title or 'Untitled song'
        self.source = source or ''

class BadWitch:
    # Our program
    def __init__(self):
        # Set up arguments
        self.argparser = argparse.ArgumentParser(description='Manage a declarative music library through YouTube scraping')
        self.argparser.add_argument('action', metavar='action', nargs='+',
                choices=['download', 'add', 'remove'],
                help='Action to perform on the library')
        self.argparser.add_argument('-l', '--library', metavar='f', nargs=1,
                help='Override default library file with this one')
        self.argparser.add_argument('-v', '--verbose', action='store_true',
                help='Show more status messages')

    def execute(self):
        self.args = self.argparser.parse_args() 
        if self.args.verbose:
            print(self.args.config)
            print(self.args.downloadall)
            print(self.args.verbose)

    def load(self, library):
        # Load a library as an object
        return

    def add(self, song):
        # Add a song to the library
        return

    def remove(self):
        # Use keyword arguments here
        # Remove a song based on criterea
        return

badwitch = BadWitch()
badwitch.execute()