Browse Source

Fix argparse required and remove output from update

Nathaniel van Diepen 3 years ago
parent
commit
0013926c89
1 changed files with 1 additions and 22 deletions
  1. 1 22
      pacman_repo/__init__.py

+ 1 - 22
pacman_repo/__init__.py

@@ -7,29 +7,8 @@ from .repo import Repo
 from . import server
 
 def update(args, config):
-    print(config.path)
-    print('---')
-    print()
-    print(config)
-    print()
-    for repo in config.repos:
-        print(repo.path)
-        print('---')
-        print()
-        print(repo)
-        print()
-
-    for server in config.servers:
-        print(server.path)
-        print('---')
-        print()
-        print(server)
-        print()
-
-    repos = []
     for repo in config.repos:
         repo = Repo(repo)
-        repos.append(repo)
         print("Repo: {}".format(repo.name))
         for package in repo.packages:
             package.update()
@@ -49,7 +28,7 @@ def main(argv):
         default='/etc/pacman-repo.d',
         help="Configuration folder path"
     )
-    subparsers = parser.add_subparsers()
+    subparsers = parser.add_subparsers(required=True, dest='command', metavar='command')
     # Update command
     update_parser = subparsers.add_parser('update', help='Update repository')
     update_parser.add_argument(