{"id":20850556,"url":"https://github.com/khalilouali/align-rs","last_synced_at":"2025-05-12T04:31:32.007Z","repository":{"id":181926513,"uuid":"667679283","full_name":"KhalilOuali/align-rs","owner":"KhalilOuali","description":"A command-line utility which aligns a block of text within the terminal (or a specified number of columns), written in Rust.","archived":false,"fork":false,"pushed_at":"2023-07-18T14:40:20.000Z","size":436,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-08T15:17:47.562Z","etag":null,"topics":["alignment","cli","output-formatting","rust-lang","text-tools"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/KhalilOuali.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-18T04:22:10.000Z","updated_at":"2023-10-01T18:42:33.000Z","dependencies_parsed_at":"2023-07-18T05:28:57.589Z","dependency_job_id":null,"html_url":"https://github.com/KhalilOuali/align-rs","commit_stats":null,"previous_names":["khalilouali/align-rs"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhalilOuali%2Falign-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhalilOuali%2Falign-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhalilOuali%2Falign-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/KhalilOuali%2Falign-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/KhalilOuali","download_url":"https://codeload.github.com/KhalilOuali/align-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225120017,"owners_count":17423818,"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":["alignment","cli","output-formatting","rust-lang","text-tools"],"created_at":"2024-11-18T03:10:10.895Z","updated_at":"2024-11-18T03:10:11.335Z","avatar_url":"https://github.com/KhalilOuali.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# align: a command line utility for aligning text.\n\n[![Crates.io](https://img.shields.io/crates/v/align_text)](https://crates.io/crates/align_text)\n\n## ⭐ Overview\n\nAligns text within the terminal (or a specified number of columns).  \nThe text is treated as a block, and you can align the content within it, or align it within the space.\n\n## 💻 Examples:\n\n![Screenshot](Examples.png)\n\n## ⌨ Usage\n\nText is read from stdin (terminal input, pipe in, etc.), formatted according to the options, then written out.\n\n\n```\nUsage: align [OPTIONS]\n\nOptions:\n  -o, --outer \u003cOUTER\u003e      Where to align the block of text [default: left] [possible values: left, center, right]\n  -i, --inner \u003cINNER\u003e      Where to align text inside the block [default: left] [possible values: left, center, right]\n  -a, --align \u003cALIGN\u003e      Shorthand for specifiying both [possible values: left, center, right]\n  -c, --columns \u003cCOLUMNS\u003e  Number of columns. Takes text's width if 0, terminal's width if unspecified\n  -w, --wrap               Wrap the lines of text to fit in the number of columns\n  -t, --trim               Trim the spaces around the lines before aligning\n  -k, --keep               Keep the spaces on the right in output\n  -b, --bias \u003cBIAS\u003e        Offset if line can't be centered perfectly [default: left] [possible values: left, right]\n  -h, --help               Print help (see more with '--help')\n  -V, --version            Print version\n```\n\n* Tip: You can use the command twice to format a block with a specific width, then align it in a bigger space.\n\n### Error: \"couldn't get terminal width\"\n\nThis program uses the [term_size](https://crates.io/crates/term_size) crate to determine the terminal width by inspecting `stdout`, `stdin`, or `stderr`. If none of these streams is a tty (connected to the terminal), the terminal width can't be calculated.\n\nThis can happen if you're redirecting all three streams. Example: `echo \"test\" | align \u003e test.txt 2\u003e\u00261`, which produces `Error: \"couldn't get terminal width\"`.\n\nIn such a case, you must specify the number of columns yourself, see [Usage](#usage).\n\n## 🙏 Special Thanks\n\n* [clap](https://github.com/clap-rs/clap): Command Line Argument Parser for Rust.\n* [term_size](https://github.com/clap-rs/term_size-rs): A Rust library to enable getting terminal sizes and dimensions.\n* FOSS and Rust communities 💖.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhalilouali%2Falign-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkhalilouali%2Falign-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkhalilouali%2Falign-rs/lists"}