Skip to content

Commit

Permalink
[config-manager] Allow to specify the "main" section
Browse files Browse the repository at this point in the history
Also change the name of the "crepo" argument from "repo" to "section" and
fix its description to unite it with the description in documentation.
  • Loading branch information
pkratoch authored and jan-kolarik committed Feb 20, 2023
1 parent b6682c2 commit 0a51ab6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/config_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class ConfigManagerCommand(dnf.cli.Command):
@staticmethod
def set_argparser(parser):
parser.add_argument(
'crepo', nargs='*', metavar='repo',
help=_('repo to modify'))
'crepo', nargs='*', metavar='section',
help=_('configuration sections to manage, "main" or repoid'))
parser.add_argument(
'--save', default=False, action='store_true',
help=_('save the current options (useful with --setopt)'))
Expand Down Expand Up @@ -111,6 +111,8 @@ def modify_repo(self):
not_matching_repos_id = set() # IDs of not matched repositories

def match_repos(key, add_matching_repos):
if key == 'main':
return
matching = self.base.repos.get_matching(key)
if not matching:
not_matching_repos_id.add(name)
Expand Down

0 comments on commit 0a51ab6

Please sign in to comment.