# -*- coding: utf-8 -*-
"""
LemonSoap - CLI entry point.
"""
import argparse
import logging

from .scrub import Scrub
from .logger import initialize_logger


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("method",
                        help="What to do; either 'inspect' or 'scrub'.")
    parser.add_argument("file",
                        help="Filename to perform action on.")
    parser.add_argument("-o", "--output", default="output.csv",
                        help="Writes directly to a file if specified.")
    parser.add_argument("-e", "--exclusive",
                        help="If 'False' do all cleaning by default, " +
                        "otherwise only do the ones specified.")
    parser.add_argument("-d", "--dates",
                        help="Cleans and standardizes dates.")
    parser.add_argument("-he", "--headers",
                        help="Converts headers to snake_case.")
    parser.add_argument("-l", "--logger", default="none",
                        help=(("Output path of logger. If 'none' no log "
                               "kept, default is 'output.csv'.")))
    args = parser.parse_args()

    # Note that default values are specified in method_template.
    args_list = {
        "output": args.output,
        "exclusive": args.exclusive,
        "dates": args.dates,
        "headers": args.headers
    }

    if args.logger != "none":
        print("Starting logger")
        initialize_logger(args.logger)
    else:
        print("No log set.")

    # Note: Arguments passed here must match up with the kwargs parameters
    # specified in both scrub and voyeur.
    if args.method == "scrub":
        lb = Scrub(args.file, **args_list)
    elif args.method == "profile":
        raise NotImplementedError

# -*- coding: utf-8 -*-
"""
LemonSoap - CLI entry point.
"""
import argparse
import logging

from .scrub import Scrub
from .logger import initialize_logger


if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("method",
                        help="What to do; either 'inspect' or 'scrub'.")
    parser.add_argument("file",
                        help="Filename to perform action on.")
    parser.add_argument("-o", "--output", default="output.csv",
                        help="Writes directly to a file if specified.")
    parser.add_argument("-e", "--exclusive",
                        help="If 'False' do all cleaning by default, " +
                        "otherwise only do the ones specified.")
    parser.add_argument("-d", "--dates",
                        help="Cleans and standardizes dates.")
    parser.add_argument("-he", "--headers",
                        help="Converts headers to snake_case.")
    parser.add_argument("-l", "--logger", default="none",
                        help=(("Output path of logger. If 'none' no log "
                               "kept, default is 'output.csv'.")))
    args = parser.parse_args()

    # Note that default values are specified in method_template.
    args_list = {
        "output": args.output,
        "exclusive": args.exclusive,
        "dates": args.dates,
        "headers": args.headers
    }

    if args.logger != "none":
        print("Starting logger")
        initialize_logger(args.logger)
    else:
        print("No log set.")

    # Note: Arguments passed here must match up with the kwargs parameters
    # specified in both scrub and voyeur.
    if args.method == "scrub":
        lb = Scrub(args.file, **args_list)
    elif args.method == "profile":
        raise NotImplementedError

# -*- coding: utf-8 -*- LemonSoap - CLI entry point. # Note that default values are specified in method_template. # Note: Arguments passed here must match up with the kwargs parameters # specified in both scrub and voyeur.