mirror of
https://github.com/AdnanHodzic/auto-cpufreq.git
synced 2025-07-27 07:34:25 +02:00
Add --version flag to CLI (#177)
* Add --version flag to determine current app version. * Alphabetise cli flags.
This commit is contained in:
parent
984cf657a6
commit
ae86bbb86a
@ -15,14 +15,15 @@ from auto_cpufreq.core import *
|
|||||||
|
|
||||||
# cli
|
# cli
|
||||||
@click.command()
|
@click.command()
|
||||||
@click.option("--monitor", is_flag=True, help="Monitor and see suggestions for CPU optimizations")
|
|
||||||
@click.option("--live", is_flag=True, help="Monitor and make (temp.) suggested CPU optimizations")
|
|
||||||
@click.option("--install/--remove", default=True, help="Install/remove daemon for (permanent) automatic CPU optimizations")
|
|
||||||
@click.option("--stats", is_flag=True, help="View live stats of CPU optimizations made by daemon")
|
|
||||||
@click.option("--log", is_flag=True, help="Deprecated flag replaced by --stats")
|
|
||||||
@click.option("--daemon", is_flag=True, hidden=True)
|
@click.option("--daemon", is_flag=True, hidden=True)
|
||||||
@click.option("--debug", is_flag=True, help="Show debug info (include when submitting bugs)")
|
@click.option("--debug", is_flag=True, help="Show debug info (include when submitting bugs)")
|
||||||
def main(monitor, live, install, stats, log, daemon, debug):
|
@click.option("--install/--remove", default=True, help="Install/remove daemon for (permanent) automatic CPU optimizations")
|
||||||
|
@click.option("--live", is_flag=True, help="Monitor and make (temp.) suggested CPU optimizations")
|
||||||
|
@click.option("--log", is_flag=True, help="Deprecated flag replaced by --stats")
|
||||||
|
@click.option("--monitor", is_flag=True, help="Monitor and see suggestions for CPU optimizations")
|
||||||
|
@click.option("--stats", is_flag=True, help="View live stats of CPU optimizations made by daemon")
|
||||||
|
@click.option("--version", is_flag=True, help="Show currently installed version")
|
||||||
|
def main(daemon, debug, install, live, log, monitor, stats, version):
|
||||||
if len(sys.argv) == 1:
|
if len(sys.argv) == 1:
|
||||||
print("\n" + "-" * 32 + " auto-cpufreq " + "-" * 33 + "\n")
|
print("\n" + "-" * 32 + " auto-cpufreq " + "-" * 33 + "\n")
|
||||||
print("Automatic CPU speed & power optimizer for Linux")
|
print("Automatic CPU speed & power optimizer for Linux")
|
||||||
@ -110,6 +111,11 @@ def main(monitor, live, install, stats, log, daemon, debug):
|
|||||||
get_current_gov()
|
get_current_gov()
|
||||||
get_turbo()
|
get_turbo()
|
||||||
footer()
|
footer()
|
||||||
|
elif version:
|
||||||
|
footer()
|
||||||
|
distro_info()
|
||||||
|
app_version()
|
||||||
|
footer()
|
||||||
elif install:
|
elif install:
|
||||||
if os.getenv('PKG_MARKER') == "SNAP":
|
if os.getenv('PKG_MARKER') == "SNAP":
|
||||||
root_check()
|
root_check()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user