{"id":17358618,"url":"https://github.com/babak2/searchterm","last_synced_at":"2026-04-28T08:40:00.041Z","repository":{"id":172062627,"uuid":"648794913","full_name":"babak2/SearchTerm","owner":"babak2","description":null,"archived":false,"fork":false,"pushed_at":"2023-12-08T21:31:51.000Z","size":1920,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T16:17:49.516Z","etag":null,"topics":["ci-cd","cpp","docker","makefile"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/babak2.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":"2023-06-02T20:43:52.000Z","updated_at":"2024-01-13T22:59:21.000Z","dependencies_parsed_at":"2025-02-01T19:44:27.674Z","dependency_job_id":"9ef34d36-bfa4-4224-b99b-280dbc15b8a7","html_url":"https://github.com/babak2/SearchTerm","commit_stats":null,"previous_names":["babak2/textsearchprog"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/babak2/SearchTerm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babak2%2FSearchTerm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babak2%2FSearchTerm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babak2%2FSearchTerm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babak2%2FSearchTerm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/babak2","download_url":"https://codeload.github.com/babak2/SearchTerm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/babak2%2FSearchTerm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32373515,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"online","status_checked_at":"2026-04-28T02:00:07.250Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ci-cd","cpp","docker","makefile"],"created_at":"2024-10-15T19:06:12.509Z","updated_at":"2026-04-28T08:39:55.005Z","avatar_url":"https://github.com/babak2.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SearchTerm\n\nThe SearchTerm program is designed to search for matches of a search term (substring) in a source text file. It takes a command-line argument specifying the input file path, which contains the source text and the search term.\n\n## Program Requirements\n\n- The program is intended to run on Linux (Ubuntu).\n- The input file should be a text file (.txt) with a specific format.\n- The source text lines specify the \u003csource_text\u003e, and the last line specifies the \u003csearch_term\u003e.\n- The program searches the \u003csource_text\u003e for matches of the \u003csearch_term\u003e and outputs the matching lines.\n\n## Input File Format\n\nThe input file should have the following format:\n```\n\u003csource_text\u003e\n\n\u003csource_text\u003e\n\n\u003csource_text\u003e\n\n\u003csearch_term\u003e\n```\n\n- The \u003csource_text\u003e consists of lines of strings, with each line containing three words embedded in symbols, numbers, and spaces.\n\n\n- The \u003csearch_term\u003e is always on the last line and contains a single word.\n\n## Match Criteria\n\nA line from the source text is considered a match if any word on the line contains the search term as a substring.\n\n## Output Format\n\nThe program outputs the matching lines to the OS Terminal. Each line is formatted as a single-space separated square-bracket-enclosed list.\n\n- Correct Format: \n\n`[this is ok]`\n\n- Incorrect Formats: \n\n`[this, no, good]`\n\n`{this no good}`\n\n`[this,no,good]`\n\n`[ this no  good  ]`\n\nIf multiple lines match, the program outputs them in the order they appear in the source text.\n\n## Examples\n\nHere are some examples to demonstrate the program's functionality:\n\n### Example 1:\n\nInput File:\n\n```\ncat sees me\nmary likes trees\nup the hill\nee\n```\n\n\nOutput:\n\n`[cat sees me]`\n\n`[mary likes trees]`\n\n\n### Example 2:\n\nInput File:\n\n```\n\"Alice was beginning...\nto_get9_!very\n1111tired1111of1111sitting1111\nby her_sister.\non9the bank,\nand\"\"of\"\"having\nnothing to do!!!\ner\n```\n\nOutput:\n\n`[to get very]`\n\n`[by her sister]`\n\n\n## To Build\n\n`g++` is the default compiler.\n\n\n```\nmake\n```\nFor more details please refer to the `Makefile`\n\n\n## To Run\n\nIf you are already in ./build/bin directory (i.e. used cd to change to this directory)\n\n```\n./search_term  \u003cpath_to_txt_file\u003e\n```\n\nExample: \n\n`./search_term  ../../input_files/input_alice.txt`\n\n\nOtherwise, if you are in your project/working directory: \n\n```\n./build/bin/search_term  \u003cpath_to_txt_file\u003e\n```\n\n### Input file examples\n\nThere are a few input .txt files for use and testing in the `/input_files` directory\n\n\n\n## To Test\nWe use the [Catch2](https://github.com/catchorg/Catch2) framework.\n\n1. Build tests:\n```\nmake test\n```\n\n2. Run all tests:\n```\n./build/bin/test\n```\n\n3. List all tests:\n```\n./build/bin/test -l\n```\n\n4. Run a specific test (example):\n```\n./build/bin/test [validateInputFile:empty-file]\n```\n\n## Dependencies\nC++ Libraries and the version installed on the development machine.\n\nMake sure you have Docker installed (if Docker is used)\n\n### .hpp Dependencies\nThese are header-only libraries that are included as part of this project. No installation is required.\n\n- [Catch2](https://github.com/catchorg/Catch2), v2.1.2, a C++ test framework. `./test/third_party/`\n\n\n\n## Assumptions\n\nCurrently, only .txt files can be used as input files, but the program behaves properly when the wrong file type (or empty file, or file with only one line, ...) is used as input.\n\n\n# Docker \n\n## Build Docker Image:\n\nBuild the Docker image using the provided Dockerfile (Make sure you have Docker installed).\n\n```\ndocker build -t my-app:latest .\n```\n\nReplace my-app with your desired image name.\n\n\n## Run Docker Container:\n\nRun the Docker container with the built image. You can specify additional options like mounting volumes or setting environment variables.\n\n```\ndocker run -it my-app\n```\n\nReplace my-app with your actual image name.\n\n\n## Additional Options:\n\n\nTo run the container in the background, add the -d option:\n\n```\ndocker run -d my-app\n```\n\nTo map a port from the host to the container, use the -p option:\n\n```\ndocker run -p 8080:80 my-app\n```\n\nCustomize the Docker run command based on your project's requirements.\n\n## Access the Application:\n\nOpen a web browser or make requests to the exposed ports to interact with your application.\n\n\n## Stopping the Container:\n\nTo stop the running container, use the following command:\n\n```\ndocker stop \u003ccontainer-id-or-name\u003e\n```\n\nReplace \u003ccontainer-id-or-name\u003e with the actual ID or name of the running container.\n\n\n## Cleaning Up:\n\nIf you want to remove the stopped container and the built image, use the following commands:\n\n`docker rm \u003ccontainer-id-or-name\u003e`\n\n`docker rmi my-app`\n\nReplace \u003ccontainer-id-or-name\u003e with the actual ID or name of the container you want to remove.\n\n\n# CI/CD Pipeline\n\nThis project utilizes a Continuous Integration and Continuous Deployment (CI/CD) pipeline to automate the build, test, and deployment processes. The pipeline is designed to ensure code quality, catch issues early, and facilitate a smoother development workflow.\n\n## Build Status\n\n[![Build Status](https://github.com/babak2/SearchTerm/blob/master/.github/workflows/ci-cd.yml)](https://github.com/babak2/SearchTerm/actions)\n\n\n## CI/CD Configuration\n\nThe CI/CD workflow is defined in the [`.github/workflows/ci-cd.yml`](.github/workflows/ci-cd.yml) file. This configuration file specifies the steps and triggers for each phase of the pipeline.\n\n## Branches and Triggers\n\n- **Main Branch:** CI/CD is triggered automatically for changes pushed to the main branch.\n- **Feature Branches:** Additional CI/CD checks are performed on feature branches before merging.\n\n## Dependencies\n\nThe pipeline installs and verifies dependencies to ensure a consistent environment during builds and tests.\n\n\n## Feedback and Improvements\n\nI welcome feedback and contributions to enhance the efficiency and effectiveness of our CI/CD pipeline.\n\nFeel free to explore the [Actions tab](https://github.com/babak2/SearchTerm/actions) for more details on specific workflow runs and results.\n\n\n  \n## run on Windows (not tested!)\n\nThis program is written on Ubuntu 20.04.5 LTS. It may be still possible to run the program on Windows with a few considerations and modifications you may need to make to ensure the program runs correctly.\n\nHere are some steps you can follow to run a program on Windows that was originally written for Ubuntu:\n\n- Install a compatible development environment: On Windows, you will need to install a development environment that supports compiling and running C++ programs. One popular option is MinGW (Minimalist GNU for Windows), which provides a Windows port of the GNU Compiler Collection (GCC) along with other necessary tools. Install MinGW or any other compatible development environment on your Windows system.\n\n- Modify the Makefile: The Makefile may need to be modified to accommodate the differences between the build systems on Ubuntu and Windows. Specifically, you may need to update the compiler flags, library paths, and other system-specific configurations to match the Windows environment. Ensure that the Makefile is updated to work with the Windows development environment you installed.\n\n- Check for system-specific code: Review the program's code and dependencies for any system-specific code that may be incompatible with Windows. For example, if your program uses Linux-specific system calls or libraries, you may need to find equivalent Windows functions or libraries.\n\n- Compile the program: Use the modified Makefile to compile the program on your Windows system. Open a terminal or command prompt, navigate to the program's directory, and run the appropriate make command (e.g., make or make all). This will compile the program using the Windows development environment.\n\n-  Resolve platform-specific issues: Test the program on Windows and address any platform-specific issues that may arise. Debug any errors or inconsistencies that are specific to the Windows environment. This may involve adjusting code, modifying library dependencies, or addressing compatibility issues.\n\n- Run the program: Once the program is successfully compiled, you should be able to run it on Windows. Execute the program from the command prompt or terminal, providing any necessary command-line arguments or inputs as required.\n\n\n\n## License\n\nThe SearchTerm program is licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE for more information.\n\n\n## Author \n\nBabak Mahdavi Ardestani\n\nbabak.m.ardestani@gmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabak2%2Fsearchterm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbabak2%2Fsearchterm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbabak2%2Fsearchterm/lists"}