Debian Codegraph @

test cases/common/14 configure file/basename.py

raw
1 #!/usr/bin/env python3
2
3 import sys
4 import argparse
5 import os
6
7 def main():
8 parser = argparse.ArgumentParser()
9 parser.add_argument('text', nargs='*', type=str)
10 args = parser.parse_args()
11
12 text = args.text if isinstance(args.text, list) else [args.text]
13
14 output = ''
15 for t in text:
16 t = os.path.basename(t)
17
18 if not output:
19 output += t
20 else:
21 output += ' ' + t
22
23 output += '\n'
24
25 sys.stdout.write(output)
26
27 if __name__ == '__main__':
28 sys.exit(main())