diff --git a/copyparty/__main__.py b/copyparty/__main__.py index 78b26f7a..ccd81c3f 100644 --- a/copyparty/__main__.py +++ b/copyparty/__main__.py @@ -1507,6 +1507,7 @@ def add_debug(ap): ap2.add_argument("--bf-nc", metavar="NUM", type=int, default=200, help="bak-flips: stop if there's more than \033[33mNUM\033[0m files at \033[33m--kf-dir\033[0m already; default: 6.3 GiB max (200*32M)") ap2.add_argument("--bf-dir", metavar="PATH", type=u, default="bf", help="bak-flips: store corrupted chunks at \033[33mPATH\033[0m; default: folder named 'bf' wherever copyparty was started") ap2.add_argument("--bf-log", metavar="PATH", type=u, default="", help="bak-flips: log corruption info to a textfile at \033[33mPATH\033[0m") + ap2.add_argument("--no-cfg-cmt-warn", action="store_true", help=argparse.SUPPRESS) # fmt: on diff --git a/copyparty/authsrv.py b/copyparty/authsrv.py index eaa2a1ce..65604ff5 100644 --- a/copyparty/authsrv.py +++ b/copyparty/authsrv.py @@ -3017,6 +3017,19 @@ def expand_config_file( ret.append("#\033[36m closed{}\033[0m".format(ipath)) + zsl = [] + for ln in ret: + zs = ln.split(" #")[0] + if " #" in zs and zs.split("#")[0].strip(): + zsl.append(ln) + if zsl and "no-cfg-cmt-warn" not in "\n".join(ret): + t = "\033[33mWARNING: there is less than two spaces before the # in the following config lines, so instead of assuming that this is a comment, the whole line will become part of the config value:\n\n>>> %s\n\nif you are familiar with this and would like to mute this warning, specify the global-option no-cfg-cmt-warn\n\033[0m" + t = t % ("\n>>> ".join(zsl),) + if log: + log(t) + else: + print(t, file=sys.stderr) + def upgrade_cfg_fmt( log: Optional["NamedLogger"], args: argparse.Namespace, orig: list[str], cfg_fp: str