diff options
author | B Stack <bgstack15@gmail.com> | 2020-04-03 09:11:57 -0400 |
---|---|---|
committer | B Stack <bgstack15@gmail.com> | 2020-04-03 09:11:57 -0400 |
commit | 923e9f3642ab6c982c0195b366ceec85ce24007f (patch) | |
tree | 0f075af1b8ec7979b98635a056d5bbe118e2b030 /src/usr/bin/logout-manager-cli | |
parent | fix #4 fix rest of frontends for py3.8 distro (diff) | |
download | logout-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/usr/bin/logout-manager-cli')
-rwxr-xr-x | src/usr/bin/logout-manager-cli | 7 |
1 files changed, 6 insertions, 1 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']) |