diff options
author | EuAndreh <eu@euandre.org> | 2021-06-12 18:26:05 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-06-12 18:26:05 -0300 |
commit | d64e4491e417e31f35d3637ded05f5175c19b071 (patch) | |
tree | d435187a5be6b4846ff1d081a4060d55329ac582 | |
parent | TODOs.md: Add #task-7695d33d-e96e-d313-b74b-860addde01c3 (diff) | |
download | git-permalink-d64e4491e417e31f35d3637ded05f5175c19b071.tar.gz git-permalink-d64e4491e417e31f35d3637ded05f5175c19b071.tar.xz |
README.md: Add usage section
-rw-r--r-- | README.md | 24 |
1 files changed, 24 insertions, 0 deletions
@@ -9,6 +9,30 @@ config. ## Usage +```shell +# setup example "remembering" repository +$ git clone git://euandreh.xyz/remembering +$ cd remembering/ +``` + +Now inside the repository folder, running `git permalink` will try build the web URL of the given file use `xdg-open` to launch the browser (or whatever is configured): + +```shell +$ git permalink tests/ranking.sh +Opening https://git.euandreh.xyz/remembering/tree/tests/ranking.sh?id=44533e2df144e7749a382e298aea53ca11a2239e +$ git permalink tests/ranking.sh 23 +Opening https://git.euandreh.xyz/remembering/tree/tests/ranking.sh?id=44533e2df144e7749a382e298aea53ca11a2239e#n23 +``` + +Or if you just want to output the link without invoking `xdg-open`, you can use the `-p` flag: + +```shell +$ git permalink -p tests/ranking.sh 23 +https://git.euandreh.xyz/remembering/tree/tests/ranking.sh?id=44533e2df144e7749a382e298aea53ca11a2239e#n23 +$ git permalink -p tests/ranking.sh 23 +https://git.euandreh.xyz/remembering/tree/-p?id=44533e2df144e7749a382e298aea53ca11a2239e#ntests/ranking.sh +``` + ## Installation |