We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5352e44 commit aa781b0Copy full SHA for aa781b0
backend/src/hatchling/cli/__init__.py
@@ -17,7 +17,18 @@ def hatchling() -> int:
17
metadata_command(subparsers, defaults)
18
version_command(subparsers, defaults)
19
20
- kwargs = vars(parser.parse_args())
+ # Parse known arguments
21
+ kwargs, extras = parser.parse_known_args()
22
+
23
+ # Extras can exist to be detected in custom hooks and plugins,
24
+ # but they must be after a '--' separator
25
+ if extras and not extras[0] == "--":
26
+ parser.print_help()
27
+ return 1
28
29
+ # Wrap the parsed arguments in a dictionary
30
+ kwargs = vars(kwargs)
31
32
try:
33
command = kwargs.pop('func')
34
except KeyError:
0 commit comments