[projects/git-slug: 153/170] Fix setting options for subcommands

glen glen at pld-linux.org
Mon Sep 21 21:51:40 CEST 2015


commit 1acb6db2d550a372b4d2fb5ec57a94110a843635
Author: Kacper Kornet <draenog at pld-linux.org>
Date:   Wed Dec 12 00:54:27 2012 +0000

    Fix setting options for subcommands
    
    The options set by set_defaults for subcommands shouldn't be
    overridden by .gitconfig. Therefore this file has to be parsed
    before calling these functions.

 slug.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/slug.py b/slug.py
index bdfa04c..1ec361c 100755
--- a/slug.py
+++ b/slug.py
@@ -219,6 +219,7 @@ common_fetchoptions.add_argument('--depth', help='depth of fetch', default=0)
 
 parser = argparse.ArgumentParser(description='PLD tool for interaction with git repos',
         formatter_class=argparse.RawDescriptionHelpFormatter)
+parser.set_defaults(**readconfig(os.path.expanduser('~/.gitconfig')))
 
 subparsers = parser.add_subparsers(help='[-h] [options]')
 update = subparsers.add_parser('update', help='fetch repositories', parents=[common_fetchoptions],
@@ -265,6 +266,5 @@ listpkgs.add_argument('-b', '--branch', help='show packages with given branch',
 listpkgs.add_argument('repopattern', nargs='*', default = ['*'])
 listpkgs.set_defaults(func=list_packages)
 
-parser.set_defaults(**readconfig(os.path.expanduser('~/.gitconfig')))
 options = parser.parse_args()
 options.func(options)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/git-slug.git/commitdiff/4ed64f73960519a2f4fd04c42950b2c96ae795c5



More information about the pld-cvs-commit mailing list