# Path: gg/utils.py
# def success_out(msg):
#     click.echo(click.style(msg, fg="green"))
# 
# def info_out(msg):
#     click.echo(msg)
# 
# Path: gg/state.py
# def update(configfile, data):
#     state = read(configfile)
#     state.update(data)
#     write(configfile, state)
# 
# def read(configfile):
#     with open(configfile, "r") as f:
#         return json.load(f)
# 
# Path: gg/main.py
# DEFAULT_CONFIGFILE = os.path.expanduser("~/.gg.json")
# class Config:
#     def __init__(self):
# def cli(config, configfile, verbose):


import click
from gg.utils import success_out, info_out
from gg.state import update, read
from gg.main import cli, pass_config
    "--fork-name",
    default="",
    help="Name of the remote which is the fork where you push your branches.",
)
@click.option(
    "-o",
    "--origin-name",
    default="",
    help="Name of the remote which is the origin remote.",
)
@click.option(
    "-b",
    "--default-branch",
    default="",
    help="Name of the default branch.",
)
@pass_config
def config(config, fork_name="", origin_name="", default_branch=""):
    """Setting various configuration options"""
    state = read(config.configfile)
    if fork_name:
        update(config.configfile, {"FORK_NAME": fork_name})
        success_out(f"fork-name set to: {fork_name}")
    else:
        info_out(f"fork-name: {state['FORK_NAME']}")

    if origin_name:
        update(config.configfile, {"ORIGIN_NAME": origin_name})
        success_out(f"origin-name set to: {origin_name}")
    else:

# Path: gg/utils.py
# def success_out(msg):
#     click.echo(click.style(msg, fg="green"))
# 
# def info_out(msg):
#     click.echo(msg)
# 
# Path: gg/state.py
# def update(configfile, data):
#     state = read(configfile)
#     state.update(data)
#     write(configfile, state)
# 
# def read(configfile):
#     with open(configfile, "r") as f:
#         return json.load(f)
# 
# Path: gg/main.py
# DEFAULT_CONFIGFILE = os.path.expanduser("~/.gg.json")
# class Config:
#     def __init__(self):
# def cli(config, configfile, verbose):


# Path: gg/builtins/config.py
import click
from gg.utils import success_out, info_out
from gg.state import update, read
from gg.main import cli, pass_config

    "--fork-name",
    default="",
    help="Name of the remote which is the fork where you push your branches.",
)
@click.option(
    "-o",
    "--origin-name",
    default="",
    help="Name of the remote which is the origin remote.",
)
@click.option(
    "-b",
    "--default-branch",
    default="",
    help="Name of the default branch.",
)
@pass_config
def config(config, fork_name="", origin_name="", default_branch=""):
    """Setting various configuration options"""
    state = read(config.configfile)
    if fork_name:
        update(config.configfile, {"FORK_NAME": fork_name})
        success_out(f"fork-name set to: {fork_name}")
    else:
        info_out(f"fork-name: {state['FORK_NAME']}")

    if origin_name:
        update(config.configfile, {"ORIGIN_NAME": origin_name})
        success_out(f"origin-name set to: {origin_name}")
    else:

        info_out(f"origin-name: {state.get('ORIGIN_NAME', '*not set*')}")