From ede0289fd95dd70bb349a985d35a5e4bbaf4d4cb Mon Sep 17 00:00:00 2001 From: rjdbcm Date: Wed, 22 May 2024 20:42:46 -0500 Subject: [PATCH] :bug: clean up CLI help and options printout. Signed-off-by: rjdbcm --- ozi/__main__.py | 1 + ozi/fix/parser.py | 12 ++++++++++-- ozi/new/parser.py | 20 ++++++++++++++++++-- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/ozi/__main__.py b/ozi/__main__.py index c1a33f4f..a0dded7f 100644 --- a/ozi/__main__.py +++ b/ozi/__main__.py @@ -95,6 +95,7 @@ action='store_const', default=lambda: None, const=license_expression, + help=license_expression.__doc__, ) helpers.add_argument( # pragma: no cover '-i', diff --git a/ozi/fix/parser.py b/ozi/fix/parser.py index 691378ff..33433622 100644 --- a/ozi/fix/parser.py +++ b/ozi/fix/parser.py @@ -22,6 +22,7 @@ ) missing_parser.add_argument( '--add', + metavar='FILENAME', nargs='?', action='append', default=['ozi.phony'], @@ -29,6 +30,7 @@ ) missing_parser.add_argument( '--remove', + metavar='FILENAME', nargs='?', action='append', default=['ozi.phony'], @@ -68,6 +70,7 @@ source_parser.add_argument( '-a', '--add', + metavar='FILENAME', nargs='?', action='append', default=['ozi.phony'], @@ -76,17 +79,19 @@ source_parser.add_argument( '-r', '--remove', + metavar='FILENAME', nargs='?', action='append', default=['ozi.phony'], help='remove file or dir/ from project', ) source_parser.add_argument( + '-c', '--copyright-head', + metavar='HEADER', type=str, default='', help='copyright header string', - metavar='Part of the NAME project.\\nSee LICENSE...', ) source_parser.add_argument( 'target', @@ -111,6 +116,7 @@ test_parser.add_argument( '-a', '--add', + metavar='FILENAME', nargs='?', action='append', default=['ozi.phony'], @@ -119,17 +125,19 @@ test_parser.add_argument( '-r', '--remove', + metavar='FILENAME', nargs='?', action='append', default=['ozi.phony'], help='remove file or dir/ from project', ) test_parser.add_argument( + '-c', '--copyright-head', + metavar='HEADER', type=str, default='', help='copyright header string', - metavar='Part of the NAME project.\\nSee LICENSE...', ) test_parser.add_argument( 'target', diff --git a/ozi/new/parser.py b/ozi/new/parser.py index db349e68..05ae7d44 100644 --- a/ozi/new/parser.py +++ b/ozi/new/parser.py @@ -35,11 +35,12 @@ optional = project_parser.add_argument_group('PKG-INFO optional') defaults = project_parser.add_argument_group('PKG-INFO defaults') ozi_defaults.add_argument( + '-c', '--copyright-head', type=str, default='', help='copyright header string', - metavar='Part of the NAME project.\\nSee LICENSE...', + metavar='HEADER', ) ozi_defaults.add_argument( '--ci-provider', @@ -64,6 +65,7 @@ required=True, action='append', default=[], + metavar='AUTHOR_NAMES', nargs='?', ) required.add_argument( @@ -73,6 +75,7 @@ help='Author-email (Multiple Use, Single output)', required=True, default=[], + metavar='AUTHOR_EMAILS', nargs='?', action='append', ) @@ -109,7 +112,7 @@ type=str, nargs='?', default='.', - help='target directory for new project', + help='directory path for new project', ) project_output = project_parser.add_mutually_exclusive_group() project_output.add_argument( @@ -121,6 +124,7 @@ defaults.add_argument( '--audience', '--intended-audience', + metavar='AUDIENCE_NAMES', type=str, help='Classifier: Intended Audience (Multiple Use)(default: ["Other Audience"])', default=METADATA.spec.python.pkg.info.classifiers.intended_audience, @@ -132,11 +136,13 @@ type=str, choices=frozenset(('Typed', 'Stubs Only')), nargs='?', + metavar='PY_TYPED_OR_STUBS', help='Classifier: Typing (Multiple Use)(default: [Typed])', default=METADATA.spec.python.pkg.info.classifiers.typing, ) defaults.add_argument( '--environment', + metavar='ENVIRONMENT_NAMES', default=METADATA.spec.python.pkg.info.classifiers.environment, help='Classifier: Environment (Multiple Use)(default: ["Other Environment"])', action=CloseMatch, @@ -146,6 +152,7 @@ defaults.add_argument( '--license-file', default='LICENSE.txt', + metavar='LICENSE_FILENAME', choices=frozenset(('LICENSE.txt',)), help='Classifier: License File (Single Use)(default: LICENSE.txt)', type=str, @@ -161,18 +168,21 @@ default=[], action='append', nargs='?', + metavar='MAINTAINER_NAMES', help='Maintainer (Multiple Use, Single output, if different from Author)', ) optional.add_argument( '--maintainer-email', help='Maintainer-Email (Multiple Use, Single output, if different from Author-Email)', action='append', + metavar='MAINTAINER_EMAILS', default=[], nargs='?', ) optional.add_argument( '--framework', help='Classifier: Framework (Multiple Use)', + metavar='FRAMEWORK_NAMES', action=CloseMatch, type=str, nargs='?', @@ -182,12 +192,14 @@ '--project-url', help='Project-URL (Multiple Use, Comma-separated Tuple[name, url])', action='append', + metavar='PROJECT_URLS', default=[], nargs='?', ) defaults.add_argument( '--language', '--natural-language', + metavar='LANGUAGE_NAMES', default=['English'], help='Classifier: Natural Language (Multiple Use)(default: [English])', action=CloseMatch, @@ -198,6 +210,7 @@ '--topic', help='Classifier: Topic (Multiple Use)', nargs='?', + metavar='TOPIC_NAMES', action=CloseMatch, type=str, default=[], @@ -213,6 +226,7 @@ defaults.add_argument( '--long-description-content-type', '--readme-type', + metavar='README_TYPE', default='rst', choices=('rst', 'md', 'txt'), help='Description-Content-Type', @@ -225,6 +239,7 @@ type=str, nargs='?', default=[], + metavar='DIST_REQUIRES', ) output = parser.add_mutually_exclusive_group() output.add_argument('-h', '--help', action='help', help='show this help message and exit') @@ -252,6 +267,7 @@ action='append', type=str, nargs='?', + metavar='ALLOW_FILE_PATTERNS', default=METADATA.spec.python.src.allow_files, ) tools = parser.add_mutually_exclusive_group() # pragma: no cover