Skip to content

Quickly compile a source file and run that program

License

Notifications You must be signed in to change notification settings

BryantLam/compilerun

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

compilerun

Quickly compile a source file and run that program.

$ compilerun gcc c calculator -- 1 + 2
g++ (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2)
+ gcc -o calculator calculator.c
+ ./calculator 1 + 2
3

Features:

  • Tab-completion friendly: auto-detect source file from executable name

Developed as a productivity aid, compilerun is intended to be used via shell aliases or functions. By convention, the alias or function name is the compiler name with suffix r.

Examples:

alias gccr='compilerun gcc c'
alias g++r='compilerun g++ cpp,cc'

gxxr() {
    local source="$1"
    shift 1
    compilerun g++ cpp,cc "$source" -std=gnu++17 -g -O2 $@
}

About

Quickly compile a source file and run that program

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages