Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ Options:
--yac-method <method> Use YAC interpolation with specific method;
click the method button in the GUI to cycle methods at runtime
--yac-3d Fractional fill-value masking for 3D variables
-v, --version Show version
-h, --help Show help message
```

Expand All @@ -283,6 +284,7 @@ Options (uterm):
--yac Use YAC interpolation (default: avg_arith)
--yac-method <m> Use YAC interpolation method (requires WITH_YAC=1)
--yac-3d Fractional fill-value masking for 3D variables
-v, --version Show version
-h, --help Show help
```

Expand Down
3 changes: 3 additions & 0 deletions src/us_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@

#include <stddef.h>

/* Version */
#define USHOW_VERSION "0.1.3"

/* Constants */
#define EARTH_RADIUS_M 6371000.0
#define DEG2RAD (M_PI / 180.0)
Expand Down
7 changes: 6 additions & 1 deletion src/ushow.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,7 @@ static void print_usage(const char *prog) {
fprintf(stderr, " --light Use light theme (default: dark)\n");
fprintf(stderr, " -t, --threads <n> Max threads\n");
fprintf(stderr, " (default: OMP_NUM_THREADS or 4)\n");
fprintf(stderr, " -v, --version Show version\n");
fprintf(stderr, " -h, --help Show this help\n");
fprintf(stderr, "\nExamples:\n");
fprintf(stderr, " %s data.nc # Single file\n", prog);
Expand Down Expand Up @@ -834,12 +835,13 @@ static int parse_options(int argc, char **argv, int *first_data_arg) {
#endif
{"light", no_argument, 0, OPT_LIGHT},
{"threads", required_argument, 0, 't'},
{"version", no_argument, 0, 'v'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};

int opt;
while ((opt = getopt_long(argc, argv, "m:r:i:d:pt:h", long_options, NULL)) != -1) {
while ((opt = getopt_long(argc, argv, "m:r:i:d:pt:vh", long_options, NULL)) != -1) {
switch (opt) {
case 'm':
strncpy(options.mesh_file, optarg, MAX_NAME_LEN - 1);
Expand Down Expand Up @@ -915,6 +917,9 @@ static int parse_options(int argc, char **argv, int *first_data_arg) {
options.user_threads = nt;
break;
}
case 'v':
printf("ushow %s\n", USHOW_VERSION);
return 1;
case 'h':
print_usage(argv[0]);
return 1;
Expand Down
7 changes: 6 additions & 1 deletion src/uterm.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ static void print_usage(const char *prog) {
#endif
fprintf(stderr, " -t, --threads <n> Max threads\n");
fprintf(stderr, " (default: OMP_NUM_THREADS or 4)\n");
fprintf(stderr, " -v, --version Show version\n");
fprintf(stderr, " -h, --help Show this help\n\n");

fprintf(stderr, "Keys:\n");
Expand Down Expand Up @@ -888,12 +889,13 @@ static int parse_options(int argc, char **argv, int *first_data_arg) {
{"yac-3d", no_argument, 0, OPT_YAC_3D},
#endif
{"threads", required_argument, 0, 't'},
{"version", no_argument, 0, 'v'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};

int opt;
while ((opt = getopt_long(argc, argv, "m:r:i:d:t:h", long_options, NULL)) != -1) {
while ((opt = getopt_long(argc, argv, "m:r:i:d:t:vh", long_options, NULL)) != -1) {
switch (opt) {
case 'm':
strncpy(options.mesh_file, optarg, MAX_NAME_LEN - 1);
Expand All @@ -909,6 +911,9 @@ static int parse_options(int argc, char **argv, int *first_data_arg) {
options.frame_delay_ms = atoi(optarg);
if (options.frame_delay_ms < 10) options.frame_delay_ms = 10;
break;
case 'v':
printf("uterm %s\n", USHOW_VERSION);
return 1;
case 'h':
print_usage(argv[0]);
return 1;
Expand Down
Loading