From 1e5b24330b11fb2631c7bc2892ba6364309fe385 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 10 Nov 2011 00:49:42 +0000 Subject: [PATCH] llvm-build: Tidy up options. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144249 91177308-0d34-0410-b5e6-96231b3b80d8 --- utils/llvm-build/llvmbuild/main.py | 49 ++++++++++++++++++------------ 1 file changed, 29 insertions(+), 20 deletions(-) diff --git a/utils/llvm-build/llvmbuild/main.py b/utils/llvm-build/llvmbuild/main.py index f6355261ceb..2a9ef5d9073 100644 --- a/utils/llvm-build/llvmbuild/main.py +++ b/utils/llvm-build/llvmbuild/main.py @@ -487,32 +487,41 @@ configure_file(\"%s\" def main(): from optparse import OptionParser, OptionGroup parser = OptionParser("usage: %prog [options]") - parser.add_option("", "--source-root", dest="source_root", metavar="PATH", + + group = OptionGroup(parser, "Input Options") + group.add_option("", "--source-root", dest="source_root", metavar="PATH", help="Path to the LLVM source (inferred if not given)", action="store", default=None) - parser.add_option("", "--print-tree", dest="print_tree", - help="Print out the project component tree [%default]", - action="store_true", default=False) - parser.add_option("", "--write-llvmbuild", dest="write_llvmbuild", + group.add_option("", "--llvmbuild-source-root", + dest="llvmbuild_source_root", + help=( + "If given, an alternate path to search for LLVMBuild.txt files"), + action="store", default=None, metavar="PATH") + parser.add_option_group(group) + + group = OptionGroup(parser, "Output Options") + group.add_option("", "--print-tree", dest="print_tree", + help="Print out the project component tree [%default]", + action="store_true", default=False) + group.add_option("", "--write-llvmbuild", dest="write_llvmbuild", help="Write out the LLVMBuild.txt files to PATH", action="store", default=None, metavar="PATH") - parser.add_option("", "--write-library-table", - dest="write_library_table", metavar="PATH", - help="Write the C++ library dependency table to PATH", - action="store", default=None) - parser.add_option("", "--write-cmake-fragment", - dest="write_cmake_fragment", metavar="PATH", - help="Write the CMake project information to PATH", - action="store", default=None) - parser.add_option("", "--write-make-fragment", + group.add_option("", "--write-library-table", + dest="write_library_table", metavar="PATH", + help="Write the C++ library dependency table to PATH", + action="store", default=None) + group.add_option("", "--write-cmake-fragment", + dest="write_cmake_fragment", metavar="PATH", + help="Write the CMake project information to PATH", + action="store", default=None) + group.add_option("", "--write-make-fragment", dest="write_make_fragment", metavar="PATH", - help="Write the Makefile project information to PATH", + help="Write the Makefile project information to PATH", + action="store", default=None) + parser.add_option_group(group) action="store", default=None) - parser.add_option("", "--llvmbuild-source-root", - dest="llvmbuild_source_root", - help=( - "If given, an alternate path to search for LLVMBuild.txt files"), - action="store", default=None, metavar="PATH") + parser.add_option_group(group) + (opts, args) = parser.parse_args() # Determine the LLVM source path, if not given. -- 2.34.1