MCPcopy Create free account
hub / github.com/ElementsProject/elements / insert_cmd

Function insert_cmd

contrib/devtools/copyright_header.py:556–573  ·  view source on GitHub ↗
(argv)

Source from the content-addressed store, hash-verified

554"""
555
556def insert_cmd(argv):
557 if len(argv) != 3:
558 sys.exit(INSERT_USAGE)
559
560 filename = argv[2]
561 if not os.path.isfile(filename):
562 sys.exit("*** bad filename: %s" % filename)
563 _, extension = os.path.splitext(filename)
564 if extension not in ['.h', '.cpp', '.cc', '.c', '.py', '.sh']:
565 sys.exit("*** cannot insert for file extension %s" % extension)
566
567 if extension == '.py':
568 style = 'python'
569 elif extension == '.sh':
570 style = 'shell'
571 else:
572 style = 'cpp'
573 exec_insert_header(filename, style)
574
575################################################################################
576# UI

Callers 1

Calls 1

exec_insert_headerFunction · 0.85

Tested by

no test coverage detected