Format a label using a file's path and basename. Example: For file `/foo/bar.py` and label "Yours: {basename}" - The output is "Yours: bar.py"
(path, label="{path}")
| 893 | |
| 894 | |
| 895 | def format_label(path, label="{path}"): |
| 896 | """Format a label using a file's path and basename. |
| 897 | |
| 898 | Example: |
| 899 | For file `/foo/bar.py` and label "Yours: {basename}" - |
| 900 | The output is "Yours: bar.py" |
| 901 | """ |
| 902 | return label.format(path=path, basename=os.path.basename(path)) |
| 903 | |
| 904 | |
| 905 | def diff_files(options, a, b): |