Crates.io | sqdj |
lib.rs | sqdj |
version | 0.2.3 |
source | src |
created_at | 2024-09-23 16:53:55.557169 |
updated_at | 2024-09-23 22:10:18.102461 |
description | sqdj shortens delimited data |
homepage | https://github.com/dhth/squidge |
repository | https://github.com/dhth/squidge |
max_upload_size | |
id | 1384306 |
size | 15,166 |
sqdj
shortens delimited data.
cat << EOF | sqdj
src/main/scala/admin/billing/ApplicationComponents.scala
src/main/scala/admin/billing/Components.scala
src/main/scala/admin/billing/Server.scala
EOF
# s/m/s/a/b/ApplicationComponents.scala
# s/m/s/a/b/Components.scala
# s/m/s/a/b/Server.scala
sqdj
uses squidge behind the scenes.
cargo:
cargo install sqdj
cargo install --git https://github.com/dhth/squidge.git --bin sqdj
$ sqdj -h
sqdj shortens delimited data
Usage: sqdj [OPTIONS]
Options:
-d, --delimiter <STRING> Delimiter [default: /]
-r, --ignore-regex <STRING> Regex for ignoring elements (ie, they won't be shortened)
-f, --ignore-first-n <NUMBER> Ignore first n elements [default: 0]
-l, --ignore-last-n <NUMBER> Ignore last n elements [default: 1]
--output-delimiter <STRING> Output delimiter [default: /]
-h, --help Print help
cat << EOF | sqdj --ignore-first-n 1
src/main/scala/admin/billing/ApplicationComponents.scala
src/main/scala/admin/billing/Components.scala
src/main/scala/admin/billing/Server.scala
EOF
# src/m/s/a/b/ApplicationComponents.scala
# src/m/s/a/b/Components.scala
# src/m/s/a/b/Server.scala
cat << EOF | sqdj --ignore-last-n 2
src/main/scala/admin/billing/ApplicationComponents.scala
src/main/scala/admin/billing/Components.scala
src/main/scala/admin/billing/Server.scala
EOF
# s/m/s/a/billing/ApplicationComponents.scala
# s/m/s/a/billing/Components.scala
# s/m/s/a/billing/Server.scala
cat << EOF | sqdj --ignore-regex 'billing|utils'
src/main/scala/admin/billing/api/PlayTapir.scala
src/main/scala/admin/billing/api/billing/BillingApiModule.scala
src/main/scala/admin/billing/api/utils/Authenticator.scala
EOF
# s/m/s/a/billing/a/PlayTapir.scala
# s/m/s/a/billing/a/billing/BillingApiModule.scala
# s/m/s/a/billing/a/utils/Authenticator.scala