mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
pretty print help options using tabulate
This commit is contained in:
+26
-15
@@ -1,23 +1,34 @@
|
||||
from app.settings import ALLARGS
|
||||
from tabulate import tabulate
|
||||
|
||||
args = ALLARGS
|
||||
|
||||
help_args_list = [
|
||||
["--help", "-h", "Show this help message"],
|
||||
["--version", "-v", "Show the app version"],
|
||||
["--host", "", "Set the host"],
|
||||
["--port", "", "Set the port"],
|
||||
["--config", "", "Set the config path"],
|
||||
["--no-periodic-scan", "-nps", "Disable periodic scan"],
|
||||
[
|
||||
"--scan-interval",
|
||||
"-psi",
|
||||
"Set the periodic scan interval in seconds. Default is 300 seconds (5 minutes)",
|
||||
],
|
||||
[
|
||||
"--build",
|
||||
"",
|
||||
"Build the application (in development)",
|
||||
],
|
||||
]
|
||||
|
||||
HELP_MESSAGE = f"""
|
||||
Swing Music is a beautiful, self-hosted music player for your
|
||||
local audio files. Like a cooler Spotify ... but bring your own music.
|
||||
|
||||
Usage: swingmusic [options]
|
||||
|
||||
Swing Music is a beautiful, self-hosted music player for your local audio files. Like a cooler Spotify ... but bring your own music.
|
||||
|
||||
Options:
|
||||
{', '.join(args.help)}: Show this help message
|
||||
{', '.join(args.version)}: Show the app version
|
||||
|
||||
{args.host}: Set the host
|
||||
{args.port}: Set the port
|
||||
{args.config}: Set the config path
|
||||
|
||||
{', '.join(args.no_periodic_scan)}: Disable periodic scan
|
||||
{', '.join(args.periodic_scan_interval)}: Set the periodic scan interval in seconds. Default is 300 seconds (5
|
||||
minutes)
|
||||
|
||||
{args.build}: Build the application (in development)
|
||||
{tabulate(help_args_list, headers=["Option", "Short", "Description"], tablefmt="rounded_grid", maxcolwidths=[None, None, 44])}
|
||||
"""
|
||||
|
||||
"80s, 90s, the noughties and today"
|
||||
|
||||
Reference in New Issue
Block a user