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


import re
import json
import getpass
import urllib.parse
import click
import requests
from gg.utils import error_out, success_out, info_out
from gg.state import read, update, remove
from gg.main import cli, pass_config



GITHUB_URL = "https://api.github.com"


@cli.group()
@click.option(
    "-u",
    "--github-url",
    default=GITHUB_URL,
    help=f"URL to GitHub instance (default: {GITHUB_URL})",
)
@pass_config
def github(config, github_url):
    """For setting up a GitHub API token."""
    config.github_url = github_url


@github.command()
@click.argument("token", default="")

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


# Path: gg/builtins/github.py
import re
import json
import getpass
import urllib.parse
import click
import requests
from gg.utils import error_out, success_out, info_out
from gg.state import read, update, remove
from gg.main import cli, pass_config




GITHUB_URL = "https://api.github.com"


@cli.group()
@click.option(
    "-u",
    "--github-url",
    default=GITHUB_URL,
    help=f"URL to GitHub instance (default: {GITHUB_URL})",
)
@pass_config
def github(config, github_url):
    """For setting up a GitHub API token."""
    config.github_url = github_url


@github.command()
@click.argument("token", default="")

@pass_config