truc — генератор относительных ссылок | Zhbert’s Home
Домашняя страничка Zhbert'а

truc — генератор относительных ссылок

Логотип утилиты

  • Язык: Go
  • Тип: кроссплатформенное приложение под Linux, macOS, FreeBSD, Windows

CLI-Утилита предназначена для генерации относительных ссылок.

Для работы нужно указать два параметра:

  • -s (--source) — исходная ссылка;
  • -t (--target) — целевая ссылка.

В результате выполнеия будет показана относительная ссылка, указав которую в source-странице можно перейти на target-страницу.

Пример:

truc -s https://github.com/Zhbert/impomoro/tree/main/internal -t https://github.com/Zhbert/colligendis`

Результат:

    Source URL: https://github.com/Zhbert/impomoro/tree/main/internal
    Target URL: https://github.com/Zhbert/colligendis
0: github.com
1: Zhbert
2: impomoro -> colligendis
Levels back: 3
    Result URL: ../../../colligendis

Впомогательные ключи:

  • -v (--verbose) — многословный вывод;
  • -c (--copy) — автоматически копирует результат в буфер обмена.

Справка по командам:

truc is a simple CLI tool for creating true relative URLs.

Allows you to quickly calculate a relative link based on the source and destination.

Usage:
  truc [flags]
  truc [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  version     Show the utility version

Flags:
  -c, --copy            Copy to clipboard
  -h, --help            help for truc
  -s, --source string   Specify the source URL
  -t, --target string   Specify the target URL
  -v, --verbose         Enable full log

Use "truc [command] --help" for more information about a command.

Утилита распространяется под лицензией MIT, исходный код доступен на GitHub.

Скачать актуальную весрсию под вашу ОС можно в релизах на GitHub.