From 9bc74508aeaece3a4fdc21d29361556f792379b5 Mon Sep 17 00:00:00 2001 From: Konstantin Stepanov Date: Wed, 22 Dec 2010 14:33:18 +0200 Subject: [PATCH] dbuscrontab: ability to pass config file to edit for -e action --- dbuscron/shell/edit.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/dbuscron/shell/edit.py b/dbuscron/shell/edit.py index 607619f..e47dcc0 100644 --- a/dbuscron/shell/edit.py +++ b/dbuscron/shell/edit.py @@ -58,6 +58,10 @@ def run(): try: if action == '-e': + # 0. get custom config file to edit + if len(sys.argv) > 2: + conffile = sys.argv[2] + # 1. create temporary config file copy temp_file = create_temp_file(conffile) mod_time = os.path.getmtime(temp_file) @@ -102,12 +106,13 @@ def run(): else: print """ Usage: - %(myname)s { -e | -l } + %(myname)s { -e | -l | -k } [config-file] - -e edit %(conffile)s file - -l list contents of %(conffile)s file - -k check %(conffile)s's syntax + -e edit config file + -l list contents of config file + -k check config file's syntax + Default for config-file is %(conffile)s """ % dict(myname=os.path.basename(sys.argv[0]), conffile=conffile) except SystemError, e: -- 1.7.9.5