Skip to content

Commit

Permalink
bump version and include version info in the default help output
Browse files Browse the repository at this point in the history
(you can also use -v to show the version in a more terse format)
  • Loading branch information
wez committed Mar 12, 2011
1 parent 889398d commit 4cd6a02
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dnl Some intro checks and defines


AC_PREREQ(2.50) AC_PREREQ(2.50)


AC_INIT([atomicparsley],[0.9.3], AC_INIT([atomicparsley],[0.9.4],
[http://bitbucket.org/wez/atomicparsley/issues/new/]) [http://bitbucket.org/wez/atomicparsley/issues/new/])


dnl Need to disable dependency tracking option so that the universal dnl Need to disable dependency tracking option so that the universal
Expand Down
19 changes: 15 additions & 4 deletions src/main.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ static const char* shortHelp_text =
"For file-level options & padding info: see --file-help\n" "For file-level options & padding info: see --file-help\n"
"Setting custom private tag extensions: see --uuid-help\n" "Setting custom private tag extensions: see --uuid-help\n"
"Setting ID3 tags onto mpeg-4 files: see --ID3-help\n" "Setting ID3 tags onto mpeg-4 files: see --ID3-help\n"
"\n"
"----------------------------------------------------------------------" "----------------------------------------------------------------------"
; ;


Expand Down Expand Up @@ -899,19 +900,29 @@ const char* find_ID3_optarg(char *argv[], int start_optargs, const char* arg_str


//*********************************************** //***********************************************


static void show_short_help(void)
{
printf("%s\n", shortHelp_text);
ShowVersionInfo();
printf("\nReport issues at %s\n", PACKAGE_BUGREPORT);
}

int real_main(int argc, char *argv[]) int real_main(int argc, char *argv[])
{ {
if (argc == 1) { if (argc == 1) {
fprintf (stdout,"%s\n", shortHelp_text); exit(0); show_short_help();
exit(0);
} else if (argc == 2 && ((strncmp(argv[1],"-v",2) == 0) || (strncmp(argv[1],"-version",2) == 0)) ) { } else if (argc == 2 && ((strncmp(argv[1],"-v",2) == 0) || (strncmp(argv[1],"-version",2) == 0)) ) {


ShowVersionInfo(); ShowVersionInfo();
exit(0); exit(0);


} else if (argc == 2) { } else if (argc == 2) {
if ( (strncmp(argv[1],"-help",5) == 0) || (strncmp(argv[1],"--help",6) == 0) || (strncmp(argv[1],"-h",5) == 0 ) ) { if ((strncmp(argv[1],"-help",5) == 0) ||
fprintf(stdout, "%s\n", shortHelp_text); exit(0); (strncmp(argv[1],"--help",6) == 0) ||

(strncmp(argv[1],"-h",5) == 0 ) ) {
show_short_help();
exit(0);
} else if ( (strncmp(argv[1],"--longhelp", 10) == 0) || (strncmp(argv[1],"-longhelp", 9) == 0) || (strncmp(argv[1],"-Lh", 3) == 0) ) { } else if ( (strncmp(argv[1],"--longhelp", 10) == 0) || (strncmp(argv[1],"-longhelp", 9) == 0) || (strncmp(argv[1],"-Lh", 3) == 0) ) {
#if defined (_WIN32) #if defined (_WIN32)
if (UnicodeOutputStatus == WIN32_UTF16) { //convert the helptext to utf16 to preserve © characters if (UnicodeOutputStatus == WIN32_UTF16) { //convert the helptext to utf16 to preserve © characters
Expand Down

0 comments on commit 4cd6a02

Please sign in to comment.