From 0cc338b67d4f8db121dab7c63b5ce4ccbac57042 Mon Sep 17 00:00:00 2001 From: Helgi Hrafn Gunnarsson Date: Wed, 26 Nov 2025 23:02:00 +0000 Subject: [PATCH] Support for escaping comment symbols in configuration file. --- scli | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scli b/scli index e5ae3ea..e3fc63c 100755 --- a/scli +++ b/scli @@ -5933,7 +5933,12 @@ def get_cfg_file_args(file_obj): # Alternatively, can override `ArgumentParser.convert_arg_line_to_args()`. ret = {} for line in file_obj: + + # Remove content after the comment sign but allow escaping. + line = line.replace('\\#', 'ESCAPED_HASH_SIGN') line = line.split('#', 1)[0].strip() + line = line.replace('ESCAPED_HASH_SIGN', '#') + if not line: continue try: