Skip to content

Commit

Permalink
Added versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
martinberoiz committed Dec 28, 2019
1 parent 5b8fb6e commit 8b16c5c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ integer):
- **-p P** controls whether or not random permutation is done in stage 3 RJ. If `P=0` no permutation is done, if `P=1` permutation is done. Default has `P=0`.
- **-t I** Controls whether standard Normal or t distributed variables are used in RWM and in RJ moves. If `I=0` Normal variables are used, otherwise t-distributed variables with I degrees of freedom are used. Default `I=0`.
- **-f F** Uses the string F as the bases for filenames (e.g. if `F=output`, filenames are `output_log.data`, `output_mix.data` etc). (Default is `F=output`)
- **-h, --help** Prints help information on command line arguments and exit.
- **-h, --help** Prints help information on command line arguments and exits.
- **-v, --version** Prints version number and exits.

As an example, typing

Expand Down
6 changes: 6 additions & 0 deletions automix.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

/* Standard library files */

#define VERSION "1.1"

#include "user.h"
#include "utils.h"
#include <fcntl.h>
Expand Down Expand Up @@ -139,6 +141,9 @@ int main(int argc, char *argv[]) {
} else if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "--help")) {
usage(argv[0]);
return EXIT_SUCCESS;
} else if (!strcmp(argv[i], "-v") || !strcmp(argv[i], "--version")) {
printf("Version %s\n", VERSION);
return EXIT_SUCCESS;
} else {
printf("Unrecognized argument: %s\n", argv[i]);
usage(argv[0]);
Expand Down Expand Up @@ -1278,6 +1283,7 @@ void usage(char *invocation) {
} else {
name += 1;
}
printf("%s version %s\n", name, VERSION);
printf("Usage: %s [-m int] [-N int] [-n int] [-a bool] \
[-p bool] [-s int] [-t int] [-f string] [-h, --help]\n",
name);
Expand Down
2 changes: 2 additions & 0 deletions utils.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "utils.h"
#include <math.h>
#ifndef DOUB
#define DOUB
#endif
/* Combined congruential and Tauseworthe generators from SuperDuper
* package. Should work on machines with unsigned long of at least 32
* bits. JC and JT must be initialized to values with 0 < JC < 2^32 and
Expand Down

0 comments on commit 8b16c5c

Please sign in to comment.