Depermitto / HeaderPuller

Header-only package manager for C/C++ written in Go. Provides hassle-free (un)installation and simplicity in use.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cross-platform header-only package manager for C/C++ (and more!)

Install

Provided you have go installed, use this oneliner in the command-line (should work cross-platform, if not simply clone the repo and run go build):

git clone https://github.com/Depermitto/HeaderPuller && go build -C ./HeaderPuller -o "$(go env GOPATH)/bin/hp" && rm -rf ./HeaderPuller/

Capabilities

Upon pulling a file, a package log file called hp.yaml shall be created. This is the core of the package managing functionality. Every remove or pull operation will modify the content of this file, to keep everything in check. Deleting include folders without using hp commands and calling sync is undefined behaviour.

For any doubts, please refer to the help command of hp.

Pulling packages

Pull single/multi header libraries from git repositories. There are 3 variations of this command:

  • pull repo-link - providing the repo link will copy every valid file from repo-link/include to include
  • pull repo-link file - will copy that exact file if valid from repo-link to include
  • pull repo-link from - will copy every valid file from repo-link/from to from, which is by default include

Example

Pull a fantastic random number generating single-header library written in C++ (the https:// part may be omitted):

hp pull https://github.com/Depermitto/randshow
workspace
+-- include
|   +-- randshow.hpp
+-- hp.yaml
...

Listing pulled packages

List all installed packages along with their identifiers in id: package name format. Ids correspond to order the packages have been added by and names are git repository names stripped of the author.

Example

hp list
0: randshow

Removing packages

Removes files and folders of all header files encompassing a package. There are 3 variations of this command:

  • remove id - delete by id
  • remove name - remove by package name
  • remove repo-link - remove by repository link

The ids and packages names are provided by the list command.

Example

hp rm 0
workspace
+-- hp.yaml
...

Syncing

The sync command simply pulls every package in hp.yaml and overwrites overlapping content, effectively updating every package to the latest version.

Updating

The update command will automagically update the tool to the latest git commit.

Wiping hp from workspace

The wipe command removes all pulled packages and the hp.yaml file itself. Does not remove hp tool from the computer. For that functionality refer to uninstall.

Uninstall

Upon confirmation, wipes hp from the computer entirely

Knows bugs

  • [X] Update README to the newest version of software
  • [X] Fix <repo-link>/<header> pulling (e.g. miniaudio)
  • [X] Implement wiping whole hp.yaml
  • [X] Fix sync command to ignore already downloaded packages
  • [X] Make it possible to wipe an empty hp.yaml
  • [X] Upgrade itself
  • [X] Clean up codebase
  • [ ] Add comments

About

Header-only package manager for C/C++ written in Go. Provides hassle-free (un)installation and simplicity in use.


Languages

Language:Go 100.0%