Fork me on GitHub
  1. pickaxe(1)
  2. pickaxe manual
  3. pickaxe(1)


pickaxe - Uses given paths to generate a test from *.txt files


pickaxe [options] path [, path ...]
drill [options] path [, path ...]


Pickaxe provides a simple way to load, solve and rate tests (bundle of questions) written in simple text format.

By default pickaxe loads any text file given as command line argument, and searches for any txt files when given path is a directory.

Answering the questions is simple and straightforward -- simply write Your answer and press [ENTER] or [TAB] key.

pickaxe provides bunch of commands during the test. Type ? and hit enter for help.

At the end of the test, pickaxe saves given answers to answers.log, thus it is vital to either finish whole test or quit pickaxe with Control-D or Control-C. Incorrect answers will be marked by !. Example of a log file:

123: a b
!456: c d e

12: a b
!34: c d e



Turn on shell clearing before question


Turn off colors


Show pickaxe version and exit


Show help and exit


Select certain number of questions. Useful for generating small random test sessions.


Generate test in a way that all questions have only one correct answer.

NOTE: questions in input files should not contains answers that states that all other answers are incorrect, because this invalidates the algorithm (except tests in Polish language due to special hack; see code for more details).

-r, --repeat-incorrect

Repeat questions answered incorrectly. This option has no effect when used with --full-test or --single option. When this option is used, the logfile will not be generated at the end of the session and only time will be listed in statistics (since it forces all questions to be answered correctly).


Do not reveal correct answers until the end of test

-s, --sorted

Stop shuffling the questions


Stop shuffling the answers

-e, --ext=extension

Change the extension for files loaded automatically from directories (default is txt)


Quit after first syntax error in test file


Check syntax only - do not run test. Makes --sorted, --sorted-answers --select useless


Load all tests from current directory:

$ pickaxe .

Create a small test (30 question) from some files and directory and emulate the exam:

$ pickaxe file1.txt file2.tst directory --select=30 --full-test


Tests (bundle of questions) that load pickaxe are stored in text file with simple format.

Questions are separated by one or more blank lines. Each question has two parts: content and answers.


Question content is defined by lines until the first answer leading line. First line of a content must starts with a number (question index) followed by optional . (dot). Regular expression for questions are defined as follows:


Question index should be unique because it is used in answers.log file. Duplicated question index may be confusing for someone reading the log.


Answers are defined by remaining lines. Answer may span across many lines until new answers leading line is found.

Answer leading line starts with (index) and optional >> which denotes the answer is correct. Answer index is simply a letter indicating that answer. Regular expression for leading lines is defines as follows:


Addidional answer lines must match following regular expression (simple should start with a letter preceded by optional whitespaces):



If answer or question spans across lines, additional lines will be joined with a white space. If You would like to break line in particular place, write \n.


123. What kind of error You appears in this piece of C++ code:
\n[1] goto label;
\n[2] Person* person = new Person();
\n[3] label: // ...
a) syntactical
>> b) semantical
c) lexical
d) there is no error


Lines that start with #, // or ; are skipped (but does not treated as blank line).


Example test file:

// C-like comments are allowed
1. To be or not to be?
That is also the question (content).
(a) To be.
(b) Not to be.
>> (c) I do not know.

# Ruby-like comments are also allowed
1 Number listed here is recommended to be unique (note the dot is optional)
(a) To be.
(b) Not to be
    that is still answer b)
  and the number of whitespaces does not matter
>> (c) I do not know.


It is possible to run pickaxe on Windows, but dynamic console width detection, colors and diacritics (text is transliterated) and some other stuff is not available. You have been warned.


You can grab source code with git by typing:

git clone git://

Please create an issue when You found a bug. Thanks!


detach, finger, fryta, Nnidyu, pliber, sm00f, quermit


Dawid Fatyga

  1. November 2011
  2. pickaxe(1)