- Push (add) items to the end of an items file.
- Shift (remove) items from the beginning of an items file.
- Revolve i.e. Continuously shift items, passing each to a custom command.
Push an item, such as URL, to the end of a file, named urls.txt:
$ revolver --file=urls.txt --push http://forfuture.co.ke- This is basically the same as
echo http://forfuture.co.ke >> urls.txt
Push multiple URLs:
$ revolver --file=urls.txt --push https://github.com https://duckduckgo.com https://cmake.orgShift (remove) a URL from the beginning of urls.txt:
$ revolver --file=urls.txt --shift
http://forfuture.co.keShift 2 URLs from urls.txt:
$ revolver --file=urls.txt --shift=2
https://github.com
https://duckduckgo.comProcess the URLs from urls.txt, passing each URL to a custom command,
e.g. echo:
$ revolver --file=urls.txt --revolve="echo ="
revolver: running command `echo = https://cmake.org'
= https://cmake.orgrevolverwaits for the command to complete processing the URL before moving to the next one.- While the command is running, you can make
revolverskip the current item, by sending one SIGINT signal i.e. Ctrl+C. The item is pushed back to the items file. - To stop the processing, send the SIGINT signal twice, in quick succession.
Proceed to https://conan.io/source/revolver/0.1.0/GochoMugo/stable for information on project setup.
You will require CMake. From our latest release, download the tarball or zipfile and uncompress it. In the uncompressed directory:
$ mkdir build && cd build
$ cmake ..
$ make installThe make install adds the header file and shared library for revolver.
Read through include/revolver.h for more information on the API.
An example of using the API:
#include <stdio.h>
#include <revolver.h>
int main(void) {
// print the version of revolver we are using
printf("revolver %d\n", REVOLVER_VERSION);
// this is same as running:
// ./revolver --file=urls.txt --revolve="echo ="
revolver_revolve("urls.txt", "echo =");
return 0;
}The MIT License (MIT)
Copyright (c) 2016 GochoMugo (www.gmugo.in)