From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id BDFB913888F for ; Fri, 9 Oct 2015 19:35:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6A50D21C00C; Fri, 9 Oct 2015 19:35:52 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EB98221C00E for ; Fri, 9 Oct 2015 19:35:51 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id F2B4D3406F0 for ; Fri, 9 Oct 2015 19:35:50 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0DEC8DB6 for ; Fri, 9 Oct 2015 19:35:48 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1444361463.0c931533d9ad82c4c724e7de25db07851cea2f66.vapier@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/main.py X-VCS-Directories: catalyst/ X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 0c931533d9ad82c4c724e7de25db07851cea2f66 X-VCS-Branch: master Date: Fri, 9 Oct 2015 19:35:48 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: a0376148-6785-4279-ae01-49cec4ed614b X-Archives-Hash: 8a919473f64dd4557b5c941296744669 commit: 0c931533d9ad82c4c724e7de25db07851cea2f66 Author: Mike Frysinger gentoo org> AuthorDate: Fri Oct 9 03:31:03 2015 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Fri Oct 9 03:31:03 2015 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=0c931533 main: group related command line flags This makes the --help output more manageable so people can quickly scan and skip options that they don't care about. catalyst/main.py | 48 ++++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/catalyst/main.py b/catalyst/main.py index 03c13c0..e6b6447 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -168,41 +168,49 @@ Using the specfile option (-f, --file) to build a stage target: $ catalyst -f stage1-specfile.spec""" parser = argparse.ArgumentParser(epilog=epilog, formatter_class=argparse.RawDescriptionHelpFormatter) - parser.add_argument('-d', '--debug', + + parser.add_argument('-V', '--version', + action='version', version=get_version(), + help='display version information') + + group = parser.add_argument_group('Program output options') + group.add_argument('-d', '--debug', default=False, action='store_true', help='enable debugging') - parser.add_argument('-v', '--verbose', + group.add_argument('-v', '--verbose', default=False, action='store_true', help='verbose output') - parser.add_argument('-c', '--config', - type=FilePath(), - help='use specified configuration file') - parser.add_argument('-f', '--file', - type=FilePath(), - help='read specfile') - parser.add_argument('-F', '--fetchonly', - default=False, action='store_true', - help='fetch files only') - parser.add_argument('-a', '--clear-autoresume', + + group = parser.add_argument_group('Temporary file management') + group.add_argument('-a', '--clear-autoresume', default=False, action='store_true', help='clear autoresume flags') - parser.add_argument('-p', '--purge', + group.add_argument('-p', '--purge', default=False, action='store_true', help='clear tmp dirs, package cache, autoresume flags') - parser.add_argument('-P', '--purgeonly', + group.add_argument('-P', '--purgeonly', default=False, action='store_true', help='clear tmp dirs, package cache, autoresume flags and exit') - parser.add_argument('-T', '--purgetmponly', + group.add_argument('-T', '--purgetmponly', default=False, action='store_true', help='clear tmp dirs and autoresume flags and exit') - parser.add_argument('-s', '--snapshot', + + group = parser.add_argument_group('Target/config file management') + group.add_argument('-F', '--fetchonly', + default=False, action='store_true', + help='fetch files only') + group.add_argument('-c', '--config', + type=FilePath(), + help='use specified configuration file') + group.add_argument('-f', '--file', + type=FilePath(), + help='read specfile') + group.add_argument('-s', '--snapshot', help='generate a release snapshot') - parser.add_argument('-V', '--version', - action='version', version=get_version(), - help='display version information') - parser.add_argument('-C', '--cli', + group.add_argument('-C', '--cli', default=[], nargs=argparse.REMAINDER, help='catalyst commandline (MUST BE LAST OPTION)') + return parser