add version information
This commit is contained in:
parent
f127a72f11
commit
145aa5ac65
|
@ -2,6 +2,10 @@ project('psxavenc', 'c', default_options: ['c_std=c11'])
|
||||||
|
|
||||||
add_project_arguments('-D_POSIX_C_SOURCE=201112L', language : 'c')
|
add_project_arguments('-D_POSIX_C_SOURCE=201112L', language : 'c')
|
||||||
|
|
||||||
|
conf_data = configuration_data()
|
||||||
|
conf_data.set('VERSION', '"' + run_command('git', 'describe', '--tags', '--match=v*', check: true).stdout().strip() + '"')
|
||||||
|
configure_file(output: 'config.h', configuration: conf_data)
|
||||||
|
|
||||||
libm_dep = meson.get_compiler('c').find_library('m')
|
libm_dep = meson.get_compiler('c').find_library('m')
|
||||||
|
|
||||||
ffmpeg = [
|
ffmpeg = [
|
||||||
|
|
|
@ -23,6 +23,7 @@ freely, subject to the following restrictions:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
const char *format_names[NUM_FORMATS] = {
|
const char *format_names[NUM_FORMATS] = {
|
||||||
"xa", "xacd",
|
"xa", "xacd",
|
||||||
|
@ -42,6 +43,7 @@ void print_help(void) {
|
||||||
" psxavenc -t <spui|vagi> [-f freq] [-c 1-24] [-L] [-i size] [-a size] <in> <out.vag>\n"
|
" psxavenc -t <spui|vagi> [-f freq] [-c 1-24] [-L] [-i size] [-a size] <in> <out.vag>\n"
|
||||||
"\nTool options:\n"
|
"\nTool options:\n"
|
||||||
" -h Show this help message and exit\n"
|
" -h Show this help message and exit\n"
|
||||||
|
" -V Show version information and exit\n"
|
||||||
" -q Suppress all non-error messages\n"
|
" -q Suppress all non-error messages\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Output options:\n"
|
"Output options:\n"
|
||||||
|
@ -100,16 +102,24 @@ void print_help(void) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void print_version(void) {
|
||||||
|
printf("psxavenc " VERSION "\n");
|
||||||
|
}
|
||||||
|
|
||||||
int parse_args(settings_t* settings, int argc, char** argv) {
|
int parse_args(settings_t* settings, int argc, char** argv) {
|
||||||
int c, i;
|
int c, i;
|
||||||
char *next;
|
char *next;
|
||||||
while ((c = getopt(argc, argv, "?hqt:F:C:f:b:c:LR:i:a:s:IS:r:x:")) != -1) {
|
while ((c = getopt(argc, argv, "?hVqt:F:C:f:b:c:LR:i:a:s:IS:r:x:")) != -1) {
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case '?':
|
case '?':
|
||||||
case 'h': {
|
case 'h': {
|
||||||
print_help();
|
print_help();
|
||||||
return -1;
|
return -1;
|
||||||
} break;
|
} break;
|
||||||
|
case 'V': {
|
||||||
|
print_version();
|
||||||
|
return -1;
|
||||||
|
} break;
|
||||||
case 'q': {
|
case 'q': {
|
||||||
settings->quiet = true;
|
settings->quiet = true;
|
||||||
settings->show_progress = false;
|
settings->show_progress = false;
|
||||||
|
|
Loading…
Reference in New Issue