File tree 1 file changed +8
-7
lines changed
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 4
4
import sys
5
5
import argparse
6
6
from logging import Logger , basicConfig , getLogger
7
- from os import getenv , environ
7
+ from os import getenv , environ , pathsep
8
8
from pathlib import Path
9
9
from typing import List , Set , Optional
10
10
@@ -84,13 +84,14 @@ def expand(self, source: str) -> str:
84
84
parser .add_argument ('--lib' , help = 'Path to Atcoder Library' )
85
85
opts = parser .parse_args ()
86
86
87
- lib_path = Path . cwd ()
87
+ lib_paths = []
88
88
if opts .lib :
89
- lib_path = Path (opts .lib )
90
- elif 'CPLUS_INCLUDE_PATH' in environ :
91
- lib_path = Path (environ ['CPLUS_INCLUDE_PATH' ])
92
-
93
- expander = Expander ([lib_path ])
89
+ lib_paths .append (Path (opts .lib ))
90
+ if 'CPLUS_INCLUDE_PATH' in environ :
91
+ lib_paths .extend (
92
+ map (Path , filter (None , environ ['CPLUS_INCLUDE_PATH' ].split (pathsep ))))
93
+ lib_paths .append (Path .cwd ())
94
+ expander = Expander (lib_paths )
94
95
source = open (opts .source ).read ()
95
96
output = expander .expand (source )
96
97
You can’t perform that action at this time.
0 commit comments