77from enum import Enum
88from pathlib import Path
99from sys import exit as sysexit
10- from sys import stdin , stdout
10+ from sys import stdout
1111
1212from configurator import Config
1313from configurator .node import ConfigNode
@@ -44,7 +44,7 @@ def cli() -> None: # pragma: no cover
4444 parser .add_argument (
4545 "--requirements-paths" ,
4646 "-r" ,
47- help = "Filenames to read from (omit for stdin if piping, else pyproject.toml)" ,
47+ help = "Filenames to read from (default= pyproject.toml)" ,
4848 nargs = "+" ,
4949 )
5050 parser .add_argument (
@@ -116,16 +116,8 @@ def cli() -> None: # pragma: no cover
116116 )
117117 args = vars (parser .parse_args ())
118118
119- stdin_path = Path ("__stdin__" )
120119 if not args .get ("requirements_paths" ):
121- if stdin .isatty ():
122- args ["requirements_paths" ] = ["pyproject.toml" ]
123- else :
124- lines = stdin .readlines ()
125- if lines :
126- stdin_path .write_text ("\n " .join (lines ), encoding = "utf-8" )
127- else :
128- args ["requirements_paths" ] = ["pyproject.toml" ]
120+ args ["requirements_paths" ] = ["pyproject.toml" ]
129121
130122 config : ConfigNode = Config ()
131123
@@ -145,7 +137,6 @@ def cli() -> None: # pragma: no cover
145137 licensecheckConf : LC_Config = LC_Config .model_validate ({** scopedData .data , ** args })
146138
147139 ec = main (licensecheckConf )
148- stdin_path .unlink (missing_ok = True )
149140
150141 sysexit (ec .value )
151142
@@ -155,7 +146,7 @@ def main(licensecheckConf: LC_Config) -> ExitCode:
155146 exitCode = ExitCode .SUCCESS
156147
157148 # File
158- requirements_paths = licensecheckConf .requirements_paths or { "__stdin__" }
149+ requirements_paths = licensecheckConf .requirements_paths
159150 output_file = (
160151 stdout
161152 if licensecheckConf .file == ""
0 commit comments