mirror of https://github.com/wb2osz/direwolf.git
Improved error messages.
This commit is contained in:
parent
92a2097d30
commit
f8b9cae461
16
src/config.c
16
src/config.c
|
@ -709,6 +709,14 @@ static char *split (char *string, int rest_of_line)
|
|||
*
|
||||
*--------------------------------------------------------------------*/
|
||||
|
||||
static void rtfm()
|
||||
{
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("See online documentation:\n");
|
||||
dw_printf (" stable release: https://github.com/wb2osz/direwolf/tree/master/doc\n");
|
||||
dw_printf (" development version: https://github.com/wb2osz/direwolf/tree/dev/doc\n");
|
||||
dw_printf (" additional topics: https://github.com/wb2osz/direwolf-doc\n");
|
||||
}
|
||||
|
||||
void config_init (char *fname, struct audio_s *p_audio_config,
|
||||
struct digi_config_s *p_digi_config,
|
||||
|
@ -970,7 +978,8 @@ void config_init (char *fname, struct audio_s *p_audio_config,
|
|||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("ERROR - Could not open config file %s\n", filepath);
|
||||
dw_printf ("Try using -c command line option for alternate location.\n");
|
||||
return;
|
||||
rtfm();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
dw_printf ("\nReading config file %s\n", filepath);
|
||||
|
@ -1027,7 +1036,8 @@ void config_init (char *fname, struct audio_s *p_audio_config,
|
|||
if (t == NULL) {
|
||||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("Config file: Missing name of audio device for ADEVICE command on line %d.\n", line);
|
||||
continue;
|
||||
rtfm();
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
p_audio_config->adev[adevice].defined = 1;
|
||||
|
@ -1986,7 +1996,7 @@ void config_init (char *fname, struct audio_s *p_audio_config,
|
|||
dw_printf ("Config file line %d: %s with CM108 is only available when USB Audio GPIO support is enabled.\n", line, otname);
|
||||
dw_printf ("You must rebuild direwolf with CM108 Audio Adapter GPIO PTT support.\n");
|
||||
dw_printf ("See Interface Guide for details.\n");
|
||||
|
||||
rtfm();
|
||||
exit (EXIT_FAILURE);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -138,7 +138,7 @@ static BOOL cleanup_win (int);
|
|||
static void cleanup_linux (int);
|
||||
#endif
|
||||
|
||||
static void usage (char **argv);
|
||||
static void usage ();
|
||||
|
||||
#if defined(__SSE__) && !defined(__APPLE__)
|
||||
|
||||
|
@ -598,7 +598,7 @@ int main (int argc, char *argv[])
|
|||
case '?':
|
||||
|
||||
/* For '?' unknown option message was already printed. */
|
||||
usage (argv);
|
||||
usage ();
|
||||
break;
|
||||
|
||||
case 'd': /* Set debug option. */
|
||||
|
@ -742,7 +742,7 @@ int main (int argc, char *argv[])
|
|||
/* Should not be here. */
|
||||
text_color_set(DW_COLOR_DEBUG);
|
||||
dw_printf("?? getopt returned character code 0%o ??\n", c);
|
||||
usage (argv);
|
||||
usage ();
|
||||
}
|
||||
} /* end while(1) for options */
|
||||
|
||||
|
@ -987,6 +987,7 @@ int main (int argc, char *argv[])
|
|||
text_color_set(DW_COLOR_ERROR);
|
||||
dw_printf ("Pointless to continue without audio device.\n");
|
||||
SLEEP_SEC(5);
|
||||
usage ();
|
||||
exit (1);
|
||||
}
|
||||
|
||||
|
@ -1722,16 +1723,16 @@ static void usage (char **argv)
|
|||
dw_printf ("\n");
|
||||
|
||||
#if __WIN32__
|
||||
dw_printf ("Complete documentation can be found in the 'doc' folder\n");
|
||||
dw_printf ("Documentation can be found in the 'doc' folder\n");
|
||||
#else
|
||||
// TODO: Could vary by platform and build options.
|
||||
dw_printf ("Complete documentation can be found in /usr/local/share/doc/direwolf\n");
|
||||
dw_printf ("Documentation can be found in /usr/local/share/doc/direwolf\n");
|
||||
#endif
|
||||
dw_printf ("or online at https://github.com/wb2osz/direwolf/tree/master/doc\n");
|
||||
dw_printf ("additional topics: https://github.com/wb2osz/direwolf-doc\n");
|
||||
text_color_set(DW_COLOR_INFO);
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* end direwolf.c */
|
||||
|
|
Loading…
Reference in New Issue