{"id":23174130,"url":"https://github.com/dhth/squidge","last_synced_at":"2025-08-18T09:30:51.275Z","repository":{"id":257791961,"uuid":"861437082","full_name":"dhth/squidge","owner":"dhth","description":"squidge shortens delimited data","archived":false,"fork":false,"pushed_at":"2024-11-18T15:03:32.000Z","size":61,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-19T00:46:05.520Z","etag":null,"topics":["delimited-data","shortener"],"latest_commit_sha":null,"homepage":"https://docs.rs/squidge/latest/squidge","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dhth.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-22T22:05:43.000Z","updated_at":"2024-10-16T16:46:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"22d68359-6c0c-4cf4-aa8a-f40b7b89fda4","html_url":"https://github.com/dhth/squidge","commit_stats":null,"previous_names":["dhth/squidge"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhth%2Fsquidge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhth%2Fsquidge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhth%2Fsquidge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dhth%2Fsquidge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dhth","download_url":"https://codeload.github.com/dhth/squidge/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230220154,"owners_count":18192225,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["delimited-data","shortener"],"created_at":"2024-12-18T05:19:21.220Z","updated_at":"2025-08-18T09:30:51.268Z","avatar_url":"https://github.com/dhth.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ch1 align=\"center\"\u003esquidge\u003c/h1\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"https://github.com/dhth/squidge/actions/workflows/main.yml\"\u003e\u003cimg alt=\"Build status\" src=\"https://img.shields.io/github/actions/workflow/status/dhth/squidge/main.yml?style=flat-square\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://crates.io/crates/squidge\"\u003e\u003cimg alt=\"crates.io\" src=\"https://img.shields.io/crates/v/squidge?style=flat-square\u0026label=squidge%40crates.io\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://crates.io/crates/sqdj\"\u003e\u003cimg alt=\"crates.io\" src=\"https://img.shields.io/crates/v/sqdj?style=flat-square\u0026label=sqdj%40crates.io\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/dhth/squidge/releases/latest\"\u003e\u003cimg alt=\"Latest Release\" src=\"https://img.shields.io/github/release/dhth/squidge.svg?style=flat-square\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/dhth/squidge/releases\"\u003e\u003cimg alt=\"Commits Since Latest Release\" src=\"https://img.shields.io/github/commits-since/dhth/squidge/latest?style=flat-square\"\u003e\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n`squidge` shortens delimited data.\n\n```rust\nuse squidge::{Config, shorten_line};\n\nlet line = \"module/submodule/service/lib.rs\";\nlet result = shorten_line(\u0026Config::default(), \u0026line);\nlet expected = vec![\"m\", \"s\", \"s\", \"lib.rs\"];\nassert_eq!(result, expected);\n```\n\n🛠️ Configuration\n---\n\n`squidge` can be configured to shorten lines in varying ways, based on its\n`Config`.\n\n```rust\nuse squidge::Config;\nuse regex::Regex;\n\nlet re = Regex::new(\"module\").unwrap();\nlet cfg = Config {\n    // Delimiter to split the line on\n    delimiter: \"\\\\\",\n    // Number of elements to ignore (for shortening) from the start\n    ignore_first_n: 2,\n    // Number of elements to ignore (for shortening) from the end\n    ignore_last_n: 2,\n    // Optional regex to determine which components to ignore while shortening\n    ignore_regex: Some(re),\n};\n```\n\n🔧 squidge as a binary: sqdj\n---\n\n### 💾 Installation\n\n**cargo**:\n\n```sh\ncargo install --git https://github.com/dhth/squidge.git --bin sqdj\n```\n\n### ⚡️ Usage\n\n```text\n$ sqdj -h\nsqdj shortens delimited data\n\nUsage: sqdj [OPTIONS]\n\nOptions:\n  -d, --delimiter \u003cSTRING\u003e         Delimiter [default: /]\n  -r, --ignore-regex \u003cSTRING\u003e      Regex for ignoring elements (ie, they won't be shortened)\n  -p, --input-path \u003cSTRING\u003e        Input file\n  -f, --ignore-first-n \u003cNUMBER\u003e    Ignore first n elements [default: 0]\n  -l, --ignore-last-n \u003cNUMBER\u003e     Ignore last n elements [default: 1]\n  -o, --output-delimiter \u003cSTRING\u003e  Output delimiter [default: /]\n  -s, --use-stdin                  Read input from stdin\n  -h, --help                       Print help\n```\n\n```bash\ncat \u003c\u003c EOF | sqdj\nsrc/main/scala/admin/billing/ApplicationComponents.scala\nsrc/main/scala/admin/billing/Components.scala\nsrc/main/scala/admin/billing/Server.scala\nEOF\n\n# s/m/s/a/b/ApplicationComponents.scala\n# s/m/s/a/b/Components.scala\n# s/m/s/a/b/Server.scala\n```\n\n```bash\ncat \u003c\u003c EOF | sqdj --ignore-first-n 1\nsrc/main/scala/admin/billing/ApplicationComponents.scala\nsrc/main/scala/admin/billing/Components.scala\nsrc/main/scala/admin/billing/Server.scala\nEOF\n\n# src/m/s/a/b/ApplicationComponents.scala\n# src/m/s/a/b/Components.scala\n# src/m/s/a/b/Server.scala\n```\n\n```bash\ncat \u003c\u003c EOF | sqdj --ignore-last-n 2\nsrc/main/scala/admin/billing/ApplicationComponents.scala\nsrc/main/scala/admin/billing/Components.scala\nsrc/main/scala/admin/billing/Server.scala\nEOF\n\n# s/m/s/a/billing/ApplicationComponents.scala\n# s/m/s/a/billing/Components.scala\n# s/m/s/a/billing/Server.scala\n```\n\n```bash\ncat \u003c\u003c EOF | sqdj --ignore-regex 'billing|utils'\nsrc/main/scala/admin/billing/api/PlayTapir.scala\nsrc/main/scala/admin/billing/api/billing/BillingApiModule.scala\nsrc/main/scala/admin/billing/api/utils/Authenticator.scala\nEOF\n\n# s/m/s/a/billing/a/PlayTapir.scala\n# s/m/s/a/billing/a/billing/BillingApiModule.scala\n# s/m/s/a/billing/a/utils/Authenticator.scala\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhth%2Fsquidge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdhth%2Fsquidge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdhth%2Fsquidge/lists"}