Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sort.py: use script name in usage/main docstring
Note: This depends on `os.path` and `sys.argv`, so the imports have to appear before the docstring. In which case, the docstring has to be explicitly assigned to `__doc__` (as it ceases to be the first statement in the file). Example outputs of the script name (using `print(argv[0]); return`: $ ./contrib/sort.py ./contrib/sort.py $ python contrib/sort.sh contrib/sort.py $ (cd contrib && ./sort.py) ./sort.py
- Loading branch information