added click cli options

This commit is contained in:
Fredrick W. Warren 2025-02-26 13:12:24 -07:00
parent df74472937
commit 153665883f

View File

@ -6,17 +6,19 @@ Copyright (C) 2025 Fredrick W. Warren
Licensed under the GNU General Public License.
"""
import logging
from wmdocklib import wmoo as wmoo
import click
import dbus
import dbus.mainloop.glib
from gi.repository import GLib
import threading
import logging
import os
import threading
from gi.repository import GLib
from icecream import ic
from wmdocklib import wmoo as wmoo
from xpm_resources import palette, background, patterns
line_height = 9
config_file = os.path.expanduser("~/.config") + '/pywmreceived/config.ini'
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
@ -237,13 +239,16 @@ def run_glib_mainloop():
except KeyboardInterrupt:
loop.quit()
def main():
@click.command()
@click.option('--config', '-c', default=config_file, help='Path to the configuration file.')
@click.option('--debug/-d', envvar='DEVELOPMENT', default='false', help='Enable debug output')
def main(config, debug):
"""
The main entry point of the application.
Parameters:
"""
if os.environ.get("PRODUCTION") == "true":
if not debug:
ic.disable()
app = Application(font_name='5x8',