Skip to content

su8/grepc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Run the commands one after another in /usr/bin.

grepc C/C++ CI

Faster wc implementation program. I made it for fun, this program ain't going to replace ordinary wc anytime soon.

Compile

make -j8 # to use 8 cores/threads in parallel compile
sudo make install

Now to run the program type grepc -m . or if you want to use it from a pipe ls | grepc -l .


Program options

You must specify which option to use. Without specifying one, the program won't do anything.

-m prints the total number of files and folders for each given folder right after the -m option

-b prints the total bytes for given file in a row and you can specify folder to traverse right after the -b option

-l prints count the total input given from stdin input, e.g. feeded by other programs in a pipe


Windows users

Tested with Visual Studio Code Editor, but you need to install MingW, once downloaded extract it to C:\MingW, then re-open Visual Studio Code Editor, you might want to install C\C++ extensions if you plan to write C\C++ code with the editor. If you plan to contribute to this project go to File->Preferences->Settings and type to search for cppStandard and set it to c17 to both C++ and C.

I use One Monokai theme for the VScode Editor

In Visual Studio Code Editor, go to Terminal->Configure Tasks...->Create tasks.json from template and copy and paste this into it:

{
  "version": "2.0.0",
  "tasks": [
    {
        "type": "cppbuild",
        "label": "C/C++",
        "command": "C:\\MingW\\bin\\g++.exe",
        "args": [
            "-fdiagnostics-color=always",
            "-std=c++17",
            "-ggdb",
            "-lpthread",
            "-Wall",
            "-Wextra",
            "-O2",
            "-pipe",
            "-pedantic",
            "-Wundef",
            "-Wshadow",
            "-W",
            "-Wwrite-strings",
            "-Wcast-align",
            "-Wstrict-overflow=5",
            "-Wconversion",
            "-Wpointer-arith",
            "-Wformat=2",
            "-Wsign-compare",
            "-Wendif-labels",
            "-Wredundant-decls",
            "-Winit-self",
            "${file}",
            "-o",
            "${fileDirname}/${fileBasenameNoExtension}"
        ],
        "options": {
            "cwd": "C:\\MingW\\bin"
        },
        "problemMatcher": [
            "$gcc"
        ],
        "group": {
            "kind": "build",
            "isDefault": true
        },
        "detail": "compiler: C:\\MingW\\bin\\g++.exe"
    }
]
}

Optioanlly if you want to play around with the code from VSCode's console -- press CTRL + SHIFT + B wait until it compiles, after that press CTRL + ` and paste this cp -r C:\Users\YOUR_USERNAME_GOES_HERE\Desktop\main.exe C:\MingW\bin;cd C:\MingW\bin;.\main.exe


Uninstall

sudo make uninstall

About

Faster than `wc' command

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published