diff --git a/bdfr/__main__.py b/bdfr/__main__.py index e35ba0a..2823ce1 100644 --- a/bdfr/__main__.py +++ b/bdfr/__main__.py @@ -20,15 +20,16 @@ _common_options = [ click.argument("directory", type=str), click.option("--authenticate", is_flag=True, default=None), click.option("--config", type=str, default=None), - click.option("--opts", type=str, default=None), click.option("--disable-module", multiple=True, default=None, type=str), click.option("--exclude-id", default=None, multiple=True), click.option("--exclude-id-file", default=None, multiple=True), click.option("--file-scheme", default=None, type=str), + click.option("--filename-restriction-scheme", type=click.Choice(("linux", "windows")), default=None), click.option("--folder-scheme", default=None, type=str), click.option("--ignore-user", type=str, multiple=True, default=None), click.option("--include-id-file", multiple=True, default=None), click.option("--log", type=str, default=None), + click.option("--opts", type=str, default=None), click.option("--saved", is_flag=True, default=None), click.option("--search", default=None, type=str), click.option("--submitted", is_flag=True, default=None), diff --git a/bdfr/configuration.py b/bdfr/configuration.py index 0d00192..78ae12e 100644 --- a/bdfr/configuration.py +++ b/bdfr/configuration.py @@ -23,6 +23,7 @@ class Configuration(Namespace): self.exclude_id = [] self.exclude_id_file = [] self.file_scheme: str = "{REDDITOR}_{TITLE}_{POSTID}" + self.filename_restriction_scheme = None self.folder_scheme: str = "{SUBREDDIT}" self.ignore_user = [] self.include_id_file = [] diff --git a/bdfr/connector.py b/bdfr/connector.py index 6d7bc64..8fe149a 100644 --- a/bdfr/connector.py +++ b/bdfr/connector.py @@ -107,6 +107,10 @@ class RedditConnector(metaclass=ABCMeta): self.args.time_format = option if not self.args.disable_module: self.args.disable_module = [self.cfg_parser.get("DEFAULT", "disabled_modules", fallback="")] + if not self.args.filename_restriction_scheme: + self.args.filename_restriction_scheme = self.cfg_parser.get( + "DEFAULT", "filename_restriction_scheme", fallback=None + ) # Update config on disk with open(self.config_location, "w") as file: self.cfg_parser.write(file)