14514f5e3Sopenharmony_ci#!/usr/bin/env python3
24514f5e3Sopenharmony_ci#coding: utf-8
34514f5e3Sopenharmony_ci"""
44514f5e3Sopenharmony_ciCopyright (c) 2022-2023 Huawei Device Co., Ltd.
54514f5e3Sopenharmony_ciLicensed under the Apache License, Version 2.0 (the "License");
64514f5e3Sopenharmony_ciyou may not use this file except in compliance with the License.
74514f5e3Sopenharmony_ciYou may obtain a copy of the License at
84514f5e3Sopenharmony_ci
94514f5e3Sopenharmony_ci    http://www.apache.org/licenses/LICENSE-2.0
104514f5e3Sopenharmony_ci
114514f5e3Sopenharmony_ciUnless required by applicable law or agreed to in writing, software
124514f5e3Sopenharmony_cidistributed under the License is distributed on an "AS IS" BASIS,
134514f5e3Sopenharmony_ciWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
144514f5e3Sopenharmony_ciSee the License for the specific language governing permissions and
154514f5e3Sopenharmony_cilimitations under the License.
164514f5e3Sopenharmony_ci
174514f5e3Sopenharmony_ciDescription: run script
184514f5e3Sopenharmony_ci    input: input file
194514f5e3Sopenharmony_ci    output: output file
204514f5e3Sopenharmony_ci    prefix: prefix
214514f5e3Sopenharmony_ci"""
224514f5e3Sopenharmony_ci
234514f5e3Sopenharmony_ciimport argparse
244514f5e3Sopenharmony_ciimport sys
254514f5e3Sopenharmony_ci
264514f5e3Sopenharmony_ci
274514f5e3Sopenharmony_cidef main():
284514f5e3Sopenharmony_ci    parser = argparse.ArgumentParser()
294514f5e3Sopenharmony_ci    parser.add_argument('--input', type=str, required=True)
304514f5e3Sopenharmony_ci    parser.add_argument('--output', type=str, required=True)
314514f5e3Sopenharmony_ci    parser.add_argument('--prefix', type=str, required=True)
324514f5e3Sopenharmony_ci
334514f5e3Sopenharmony_ci    args = parser.parse_args()
344514f5e3Sopenharmony_ci
354514f5e3Sopenharmony_ci    with open(args.input, 'r') as input_file, open(args.output, 'w') as output_file:
364514f5e3Sopenharmony_ci        for line in input_file:
374514f5e3Sopenharmony_ci            output_line = args.prefix + line
384514f5e3Sopenharmony_ci            output_file.write(output_line)
394514f5e3Sopenharmony_ci
404514f5e3Sopenharmony_ciif __name__ == '__main__':
414514f5e3Sopenharmony_ci    sys.exit(main())
42