Skip to content

Commit

Permalink
🐛 clean up CLI help and options printout.
Browse files Browse the repository at this point in the history
Signed-off-by: rjdbcm <[email protected]>
  • Loading branch information
rjdbcm committed May 23, 2024
1 parent 640e37e commit ede0289
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
1 change: 1 addition & 0 deletions ozi/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@
action='store_const',
default=lambda: None,
const=license_expression,
help=license_expression.__doc__,
)
helpers.add_argument( # pragma: no cover
'-i',
Expand Down
12 changes: 10 additions & 2 deletions ozi/fix/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,15 @@
)
missing_parser.add_argument(
'--add',
metavar='FILENAME',
nargs='?',
action='append',
default=['ozi.phony'],
help=SUPPRESS,
)
missing_parser.add_argument(
'--remove',
metavar='FILENAME',
nargs='?',
action='append',
default=['ozi.phony'],
Expand Down Expand Up @@ -68,6 +70,7 @@
source_parser.add_argument(
'-a',
'--add',
metavar='FILENAME',
nargs='?',
action='append',
default=['ozi.phony'],
Expand All @@ -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',
Expand All @@ -111,6 +116,7 @@
test_parser.add_argument(
'-a',
'--add',
metavar='FILENAME',
nargs='?',
action='append',
default=['ozi.phony'],
Expand All @@ -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',
Expand Down
20 changes: 18 additions & 2 deletions ozi/new/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -64,6 +65,7 @@
required=True,
action='append',
default=[],
metavar='AUTHOR_NAMES',
nargs='?',
)
required.add_argument(
Expand All @@ -73,6 +75,7 @@
help='Author-email (Multiple Use, Single output)',
required=True,
default=[],
metavar='AUTHOR_EMAILS',
nargs='?',
action='append',
)
Expand Down Expand Up @@ -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(
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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='?',
Expand All @@ -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,
Expand All @@ -198,6 +210,7 @@
'--topic',
help='Classifier: Topic (Multiple Use)',
nargs='?',
metavar='TOPIC_NAMES',
action=CloseMatch,
type=str,
default=[],
Expand All @@ -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',
Expand All @@ -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')
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ede0289

Please sign in to comment.