{"id":16338129,"url":"https://github.com/rohaquinlop/rust-compare-files","last_synced_at":"2025-03-20T23:31:04.653Z","repository":{"id":220709584,"uuid":"752374151","full_name":"rohaquinlop/rust-compare-files","owner":"rohaquinlop","description":"A simple CLI tool to compare two files. Written in Rust","archived":false,"fork":false,"pushed_at":"2024-04-30T05:56:43.000Z","size":16,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T20:12:25.067Z","etag":null,"topics":["cli","command-line-tool","rust","rust-lang"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/compare-files","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rohaquinlop.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-02-03T18:38:58.000Z","updated_at":"2024-05-13T03:50:34.000Z","dependencies_parsed_at":null,"dependency_job_id":"73c9af25-bf51-49eb-a2c2-ea69b1bf6eea","html_url":"https://github.com/rohaquinlop/rust-compare-files","commit_stats":null,"previous_names":["rohaquinlop/rust-compare-files"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohaquinlop%2Frust-compare-files","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohaquinlop%2Frust-compare-files/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohaquinlop%2Frust-compare-files/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rohaquinlop%2Frust-compare-files/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rohaquinlop","download_url":"https://codeload.github.com/rohaquinlop/rust-compare-files/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244090742,"owners_count":20396472,"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":["cli","command-line-tool","rust","rust-lang"],"created_at":"2024-10-10T23:49:42.412Z","updated_at":"2025-03-20T23:31:04.358Z","avatar_url":"https://github.com/rohaquinlop.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# compare-files\n\nThis a simple CLI tool to compare two files and show the differences.\nIt is written in Rust.\n\nThe tool is inspired by the `diff` command and `git` changes visualization,\nbut it is simpler and easier to use.\nAlways, the first file is the reference, and the second file is the one to compare.\n\n## Installation\n\n### From crates.io\n\nTo install the tool, you need to have [Rust](https://www.rust-lang.org/tools/install)\ninstalled. Then, you can run the following command:\n\n```bash\ncargo install compare-files\n```\n\n### From source\n\nor you can clone the repository:\n\n```bash\ngit clone https://github.com/rohaquinlop/rust-compare-files.git\ncd rust-compare-files\ncargo install --path .\n```\n\n## Usage\n\nTo compare two files, you can run the following command:\n\n```bash\ncompare-files /path/to/file1 /path/to/file2\n```\n\nThe output will show the differences between the two files.\nFor example, if the files are:\n\n```plaintext\nfile1.txt:\n1\n2\n3\nfile2.txt:\n1\n3\n4\n```\n\nThe output will be:\n\n```plaintext\n1: 1\n2: - 2\n3: 3\n3: + 4\n\nThe files you provided are differents!\n\nHere is the summary:\n+ 1 line added.\n- 1 line deleted.\n```\n\nAs you can see, the output shows the differences between both files.\nIf you're using an ansi-compatible terminal, you can see the output with colors.\n\nLet's say you have two files, `file1.txt` and `file2.txt`, and you want\nto compare them. You can run the following command:\n\n```bash\ncompare-files file1.txt file2.txt\n```\n\nEven, you can compare them if they are in different directories:\n\n```bash\ncompare-files ~/Documents/file1.txt ./file2.txt\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohaquinlop%2Frust-compare-files","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frohaquinlop%2Frust-compare-files","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frohaquinlop%2Frust-compare-files/lists"}