mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-04-15 18:11:48 +04:00
Add PRE_COMIMT_ARGV environment variable
Signed-off-by: Jordi Clariana <jordi.clariana@ankorstore.com>
This commit is contained in:
parent
c69ae26c1f
commit
a833e48ab8
1 changed files with 3 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ from __future__ import annotations
|
||||||
import argparse
|
import argparse
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import sys
|
import sys
|
||||||
from typing import Sequence
|
from typing import Sequence
|
||||||
|
|
||||||
|
|
@ -346,6 +347,8 @@ def main(argv: Sequence[str] | None = None) -> int:
|
||||||
argv = ['run']
|
argv = ['run']
|
||||||
args = parser.parse_args(argv)
|
args = parser.parse_args(argv)
|
||||||
|
|
||||||
|
os.environ['PRE_COMMIT_ARGV'] = ' '.join([re.escape(x) for x in argv])
|
||||||
|
|
||||||
if args.command == 'help' and args.help_cmd:
|
if args.command == 'help' and args.help_cmd:
|
||||||
parser.parse_args([args.help_cmd, '--help'])
|
parser.parse_args([args.help_cmd, '--help'])
|
||||||
elif args.command == 'help':
|
elif args.command == 'help':
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue