Skip to content

Commit

Permalink
Fix commit f7373b7:
Browse files Browse the repository at this point in the history
Show version and help if no arguments given, but ONLY IF default config file isn't found. Otherwise use the default config file just as we always were prior to commit f7373b7.

Fixes GitHub Issue SDL-Hercules-390#548.
  • Loading branch information
Fish-Git committed Mar 3, 2023
1 parent f1f12d5 commit 440e62e
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -835,14 +835,6 @@ int rc;
init_progname( argc, argv );
init_sysblk_version_str_arrays( NULL );

if (argc < 2)
{
display_version( stdout, 0, NULL );
arghelp();
WRMSG( HHC02343, "S", 1 );
return 1;
}

/* Initialize SETMODE and set user authority */
SETMODE( INIT );

Expand Down Expand Up @@ -1147,9 +1139,15 @@ int rc;
set_thread_priority_id( sysblk.loggertid, sysblk.srvprio );
LOG_TID_BEGIN( sysblk.loggertid, LOGGER_THREAD_NAME );

/* Always show version right away */
display_version( stdout, 0, NULL );

/* Process command-line arguments. Exit if any serious errors. */
if ((rc = process_args( argc, argv )) != 0)
{
/* Show them our command line arguments */
arghelp();

// "Terminating due to %d argument errors"
WRMSG( HHC02343, "S", rc );
delayed_exit( rc );
Expand Down Expand Up @@ -1853,8 +1851,8 @@ static int process_args( int argc, char* argv[] )
/* Terminate if invalid arguments were detected */
if (arg_error)
{
/* Show them all of our command-line arguments... */
arghelp();
/* Do nothing. Caller will call "arghelp" to
show them our command-line arguments... */
}
else /* Check for config and rc file, but don't open */
{
Expand Down

0 comments on commit 440e62e

Please sign in to comment.