diff --git a/borgmatic/commands/arguments.py b/borgmatic/commands/arguments.py index 5d980a72..dc72535f 100644 --- a/borgmatic/commands/arguments.py +++ b/borgmatic/commands/arguments.py @@ -288,6 +288,9 @@ def parse_arguments_for_actions(unparsed_arguments, action_parsers, global_parse ) +OMITTED_FLAG_NAMES = {'progress', 'stats', 'list'} + + def add_arguments_from_schema(arguments_group, schema, unparsed_arguments, names=None): ''' Given an argparse._ArgumentGroup instance, a configuration schema dict, and a sequence of @@ -376,6 +379,11 @@ def add_arguments_from_schema(arguments_group, schema, unparsed_arguments, names description = description.replace('%', '%%') + # These options already have corresponding flags on individual actions (like "create + # --progress"), so don't bother adding them to the global flags. + if flag_name in OMITTED_FLAG_NAMES: + return + argument_type = borgmatic.config.schema.parse_type(schema_type) full_flag_name = f"--{flag_name.replace('_', '-')}" diff --git a/borgmatic/config/schema.yaml b/borgmatic/config/schema.yaml index 006b9436..86cc5255 100644 --- a/borgmatic/config/schema.yaml +++ b/borgmatic/config/schema.yaml @@ -813,21 +813,24 @@ properties: type: boolean description: | Display progress as each file or archive is processed when running - supported actions. Defaults to false. + supported actions. Corresponds to the "--progress" flag on those + actions. Defaults to false. default: false example: true stats: type: boolean description: | Display statistics for an archive when running supported actions. - Defaults to false. + Corresponds to the "--stats" flag on those actions. Defaults to + false. default: false example: true list: type: boolean description: | Display details for each file or archive as it is processed when - running supported actions. Defaults to false. + running supported actions. Corresponds to the "--list" flag on those + actions. Defaults to false. default: false example: true skip_actions: