Giter Club home page Giter Club logo

branch-checklist's Introduction

branch-checklist

This is a little utility that I created to learn how to parse files and text in C.

Basically, you run the program executable with a directory argument to parse a .java file and look for any lines starting with if.

The program works by recursing over the given directory and looking for files that end in .java in them. It will scan each file line-by-line by populating a dynamically sized string, using realloc only to expand the string and then scanning each line to see if it begins with if, ignoring leading spaces. If it does, it will print out the file's line number followed by the line itself into the console.

Building

git clone https://github.com/caojohnny/branch-checklist.git
cd branch-checklist
mkdir build
cd build
cmake .. && make

The executable will be in the build directory as branch-checklist.

Alternatively, you can also head over to the releases page and download the executable yourself.

Demo

$ ./branch-checklist /home/caojohnny/CLionProjects/branch-checklist/test
Parsing directory "/home/caojohnny/CLionProjects/branch-checklist/test/"...
Processing file: "/home/caojohnny/CLionProjects/branch-checklist/test/Branches.java"...
3         if (args.length == 4) {
7         if (args.length == 6) {
Parsing directory "/home/caojohnny/CLionProjects/branch-checklist/test/test2/"...
Processing file: "/home/caojohnny/CLionProjects/branch-checklist/test/test2/Branches2.java"...
3         if (args.length == 4) {
7         if (args.length == 6) {

Notes

  • Tabs probably aren't supported, I haven't checked

Credits

Built with CLion

branch-checklist's People

Contributors

caojohnny avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.