4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
19 from tools.package import PackageConfigReader
23 p = argparse.ArgumentParser(
24 description='Read package configuration',
25 formatter_class=argparse.ArgumentDefaultsHelpFormatter)
26 p.add_argument('--config', required=False, help='Package YAML config file path')
27 p.add_argument('--separator', required=False, default=' ',
28 help='Separator for the resulting stdout list')
29 p.add_argument('package_operation_type', choices=['install', 'uninstall'],
30 help='list packages by operation type')
31 args = p.parse_args(args)
36 args = parse(input_args)
38 if args.config is not None:
39 kwargs['config_file'] = args.config
40 print(args.separator.join(PackageConfigReader(**kwargs).get(args.package_operation_type)))
43 if __name__ == "__main__":