tuned, tuned-adm: added new option --version, -v to show version
Signed-off-by: Jaroslav Škarvada <jskarvad@redhat.com>
This commit is contained in:
parent
fe3d97a8fa
commit
b68fea0ca9
3 changed files with 7 additions and 1 deletions
|
|
@ -23,6 +23,7 @@ import argparse
|
|||
import sys
|
||||
import traceback
|
||||
import tuned.admin
|
||||
import tuned.version as ver
|
||||
|
||||
DBUS_BUS = "com.redhat.tuned"
|
||||
DBUS_OBJECT = "/Tuned"
|
||||
|
|
@ -30,6 +31,7 @@ DBUS_INTERFACE = "com.redhat.tuned.control"
|
|||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description="Manage tuned daemon.")
|
||||
parser.add_argument('--version', "-v", action = "version", version = "%%(prog)s %s.%s.%s" % (ver.TUNED_VERSION_MAJOR, ver.TUNED_VERSION_MINOR, ver.TUNED_VERSION_PATCH))
|
||||
parser.add_argument("--debug", action="store_true", help=argparse.SUPPRESS)
|
||||
subparsers = parser.add_subparsers()
|
||||
|
||||
|
|
|
|||
3
tuned.py
3
tuned.py
|
|
@ -27,6 +27,7 @@ import tuned.logs
|
|||
import tuned.daemon
|
||||
import tuned.exceptions
|
||||
import tuned.consts as consts
|
||||
import tuned.version as ver
|
||||
|
||||
DBUS_BUS = "com.redhat.tuned"
|
||||
DBUS_OBJECT = "/Tuned"
|
||||
|
|
@ -42,7 +43,7 @@ if __name__ == "__main__":
|
|||
parser.add_argument("--log", "-l", nargs = "?", const = consts.LOG_FILENAME, help = "log to file, default file: " + consts.LOG_FILENAME)
|
||||
parser.add_argument("--no-dbus", action = "store_true", help = "do not attach to DBus")
|
||||
parser.add_argument("--profile", "-p", action = "store", type=str, metavar = "name", help = "tuning profile to be activated")
|
||||
|
||||
parser.add_argument('--version', "-v", action = "version", version = "%%(prog)s %s.%s.%s" % (ver.TUNED_VERSION_MAJOR, ver.TUNED_VERSION_MINOR, ver.TUNED_VERSION_PATCH))
|
||||
args = parser.parse_args(sys.argv[1:])
|
||||
|
||||
if os.geteuid() != 0:
|
||||
|
|
|
|||
3
tuned/version.py
Normal file
3
tuned/version.py
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
TUNED_VERSION_MAJOR = 2
|
||||
TUNED_VERSION_MINOR = 2
|
||||
TUNED_VERSION_PATCH = 0
|
||||
Loading…
Reference in a new issue