Skip to content
  • Guy Harris's avatar
    55ddbd31
    Use g_get_prgname() to get the program name. · 55ddbd31
    Guy Harris authored
    Have programs set the program name, at the beginning of main(), with
    g_set_prgname().  That lets other code call g_get_prgname() to get the
    program name.
    
    This lets us replace a bunch of xxx_cmdarg_err() and
    xxx_cmdarg_err_cont() routines with common code, as they differ only in
    the command name printed in error message, and the common routine can
    use g_get_prgname().
    
    This also means that ws_log_init() doesn't need to be passed the
    program name; it can juse use g_get_prgname().  The same applies to
    extcap_log_init(), which calls ws_log_init().
    
    While we're at it, have a common routine for extcaps to use ws_logv() to
    log warnings, replacing some other xxx_cmdarg_err() and
    xxx_cmdarg_err_cont() routines.
    
    Use g_get_prgname() in ws_getopt.c; this means that you don't run the
    risk of a pathname, rather than a command name, show up in the error
    message.
    55ddbd31
    Use g_get_prgname() to get the program name.
    Guy Harris authored
    Have programs set the program name, at the beginning of main(), with
    g_set_prgname().  That lets other code call g_get_prgname() to get the
    program name.
    
    This lets us replace a bunch of xxx_cmdarg_err() and
    xxx_cmdarg_err_cont() routines with common code, as they differ only in
    the command name printed in error message, and the common routine can
    use g_get_prgname().
    
    This also means that ws_log_init() doesn't need to be passed the
    program name; it can juse use g_get_prgname().  The same applies to
    extcap_log_init(), which calls ws_log_init().
    
    While we're at it, have a common routine for extcaps to use ws_logv() to
    log warnings, replacing some other xxx_cmdarg_err() and
    xxx_cmdarg_err_cont() routines.
    
    Use g_get_prgname() in ws_getopt.c; this means that you don't run the
    risk of a pathname, rather than a command name, show up in the error
    message.
Loading