#github

bin+lib ghlink

Create GitHub permanent links to specified file lines

12 releases

0.2.21 Aug 7, 2024
0.2.20 May 30, 2024

#1401 in Development tools

Download history 3/week @ 2024-06-28 18/week @ 2024-07-05 113/week @ 2024-08-02 15/week @ 2024-08-09 11/week @ 2024-09-13 7/week @ 2024-09-20 33/week @ 2024-09-27 6/week @ 2024-10-04

57 downloads per month

BSD-3-Clause

20KB
354 lines

Ghlink

Crates.io Documentation License

Ghlink creates GitHub permanent links to specified file lines of files hosted in a GitHub repository.

Usage:

ghlink [-l1 line1 [-l2 line2] | -s text] file

ghlink file prints a link to file.

ghlink -l1 line1 file prints a link to line1 in file.

ghlink -l1 line1 -l2 line2 file prints a link to lines line1 through line2 in file.

ghlink -s text file prints a link to lines matching text in file. If text is ‘-’, the standard input is used.

Examples

Print a link to README.md:

$ ghlink README.md

Print a link to line 3 in README.md:

$ ghlink -l1 3 README.md

Print a link to lines 3 through 8 in README.md:

$ ghlink -l1 3 -l2 8 README.md

Print a link to lines matching "Usage:\n\n ghlink file":

$ ghlink -s 'Usage:\n\n    ghlink file' README.md

Dependencies

~12–22MB
~333K SLoC