aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2020-04-03 09:11:57 -0400
committerB Stack <bgstack15@gmail.com>2020-04-03 09:11:57 -0400
commit923e9f3642ab6c982c0195b366ceec85ce24007f (patch)
tree0f075af1b8ec7979b98635a056d5bbe118e2b030 /src
parentfix #4 fix rest of frontends for py3.8 distro (diff)
downloadlogout-manager-923e9f3642ab6c982c0195b366ceec85ce24007f.tar.gz
logout-manager-923e9f3642ab6c982c0195b366ceec85ce24007f.tar.bz2
logout-manager-923e9f3642ab6c982c0195b366ceec85ce24007f.zip
fix #5 cli: multiple problems
Option -n now acts as a dry run. The man page -V option is documented correctly now.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/usr/bin/logout-manager-cli7
-rw-r--r--src/usr/share/man/man1/logout-manager-cli.1.md2
2 files changed, 7 insertions, 2 deletions
diff --git a/src/usr/bin/logout-manager-cli b/src/usr/bin/logout-manager-cli
index c325db4..974fd4b 100755
--- a/src/usr/bin/logout-manager-cli
+++ b/src/usr/bin/logout-manager-cli
@@ -6,6 +6,7 @@
# Title: cli logout manager
# Purpose: Feature completeness in this package
# History:
+# 2020-04-03 fix #5 -n does nothing
# Usage:
# logout-manager-cli
# Reference:
@@ -39,7 +40,7 @@ import lmlib
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
-logout_manager_cli_version="2020-03-10"
+logout_manager_cli_version="2020-04-03"
parser = argparse.ArgumentParser(description="run logout-manager commands using cli")
parser.add_argument('action', help='which action to take',nargs='?', choices=('lock','logout','hibernate','shutdown','reboot'))
@@ -49,6 +50,10 @@ parser.add_argument("-V","--version", action="version", version="%(prog)s " + lo
args = parser.parse_args()
+# handle -n
+if args.dryrun:
+ os.environ["DRYRUN"] = "from-parameters"
+
# load configs
# in cli, must happen after arparse to benefit from debug value
config = lmlib.Initialize_config(os.environ['LOGOUT_MANAGER_CONF'])
diff --git a/src/usr/share/man/man1/logout-manager-cli.1.md b/src/usr/share/man/man1/logout-manager-cli.1.md
index a775770..d4cb02c 100644
--- a/src/usr/share/man/man1/logout-manager-cli.1.md
+++ b/src/usr/share/man/man1/logout-manager-cli.1.md
@@ -14,7 +14,7 @@ Use this interface to `logout-manager`(7) from the command line or in scripts. P
-n Dryrun only! Do not take action. Useful with `hibernate` to determine if hibernate is allowed on this system.
--V --verbose be verbose
+-V --version Display version and exit
# ACTIONS
One action may be specified on the command line. See "ACTIONS" section of `logout-manager`(7) man page for a list of available actions.
# AUTHOR
bgstack15