From 7dc36feaa30e1892f673a7ca3c12d960757fb332 Mon Sep 17 00:00:00 2001 From: Gilles Grandou Date: Mon, 4 Dec 2023 23:46:19 +0100 Subject: [PATCH] add "edit" command to open config file --- runon/runon.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/runon/runon.py b/runon/runon.py index 2d35055..05120b0 100755 --- a/runon/runon.py +++ b/runon/runon.py @@ -216,7 +216,8 @@ def main(): parser.description = 'run commands on any distribution' parser.add_argument('osname', help = 'distribution name to run on, ' - '"list" to dump all available distributions') + '"list" to dump all available distributions, ' + '"edit" to open the current config file in a text editor.') parser.epilog = '(c) 2021 Gilles Grandou ' parser.add_argument('-v', '--verbose', action='store_true', @@ -246,6 +247,10 @@ def main(): print(' {}'.format(o)) print() return 0 + elif args.osname == 'edit': + cmd = [ 'xdg-open', conf_file ] + ret = subprocess.run(cmd, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL); + return 0 if args.link: make_osname_link(sys.argv[0], args.osname)