Skip to content

Commit

Permalink
Print unified version information for all AppleTalk daemons
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmark committed Nov 11, 2024
1 parent 3f25e1c commit daaa188
Show file tree
Hide file tree
Showing 16 changed files with 111 additions and 26 deletions.
11 changes: 10 additions & 1 deletion contrib/a2boot/a2boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ char *bad = "Bad request!";
char buf[ 4624 ];
char *server;
int32_t fileoff;
static char *version = VERSION;

long a2bootreq(char *fname);

Expand Down Expand Up @@ -125,14 +126,22 @@ int main( int ac, char **av )
}
server = hostname;

while (( c = getopt( ac, av, "dn:" )) != EOF ) {
while (( c = getopt( ac, av, "dVvn:" )) != EOF ) {
switch ( c ) {
case 'd' :
debug++;
break;
case 'n' :
server = optarg;
break;
case 'V' :
case 'v' :
fprintf(stdout, "a2boot %s - Apple2 Netboot Daemon\n"
"Copyright (c) 1990,1992 Regents of The University of Michigan.\n"
"\tAll Rights Reserved.\n"
"Copyright (c) 1990, The University of Melbourne.\n", version );
exit ( 1 );
break;
default :
fprintf( stderr, "Unknown option -- '%c'\n", c );
usage( *av );
Expand Down
1 change: 1 addition & 0 deletions contrib/a2boot/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ a2boot_c_args = [
+ pkgconfdir
+ '/a2boot/Apple :2f:2fe Boot Blocks"',
'-D_PATH_P16_IMAGE="' + pkgconfdir + '/a2boot/ProDOS16 Image"',
dversion,
]

executable(
Expand Down
31 changes: 17 additions & 14 deletions contrib/macipgw/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif /* HAVE_CONFIG_H */

#include <sys/types.h>
#include <sys/param.h>
#include <sys/socket.h>
Expand Down Expand Up @@ -46,17 +50,10 @@
#include "tunnel.h"
#include "util.h"

static char *version = "macipgw 1.1\n"
"Copyright (c) 1997 Stefan Bethke. All rights reserved.\n"
"Copyright (c) 1988, 1992, 1993\n"
"\tThe Regents of the University of California. All rights reserved.\n"
"Copyright (c) 1990,1996 Regents of The University of Michigan.\n"
"\tAll Rights Reserved.\n"
"See the file COPYRIGHT for further information.\n";

int atsocket;
int tundev;
int debug = 0;
static char *version = VERSION;

static void die(int n)
{
Expand Down Expand Up @@ -179,21 +176,27 @@ int main(int argc, char *argv[])

gDebug = 0;

while ((opt = getopt(argc, argv, "Vd:n:u:z:")) != -1) {
while ((opt = getopt(argc, argv, "Vvd:n:u:z:")) != -1) {
switch (opt) {
case 'd':
gDebug = strtol(optarg, 0, 0);
break;

case 'n':
ns = atoip(optarg);
break;

case 'z':
zone = optarg;
break;
case 'V':
usage(version);
break;
case 'V':
case 'v':
fprintf(stdout, "macipgw %s - Mac IP Gateway Daemon\n"
"Copyright (c) 1997, 2013 Stefan Bethke. All rights reserved.\n"
"Copyright (c) 1988, 1992, 1993\n"
"\tThe Regents of the University of California. All rights reserved.\n"
"Copyright (c) 1990, 1996 Regents of The University of Michigan.\n"
"\tAll Rights Reserved.\n"
"See the file COPYRIGHT for further information.\n", version);
exit(1);
break;
case 'u':
pwd = get_user(optarg);
Expand Down
2 changes: 1 addition & 1 deletion contrib/macipgw/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ macipgw_sources = [

macipgw_includes = include_directories('../../libatalk/atp')

macipgw_c_args = ['-DSERVERTEXT="' + pkgconfdir + '/msg"']
macipgw_c_args = ['-DSERVERTEXT="' + pkgconfdir + '/msg"', dversion]

executable(
'macipgw',
Expand Down
1 change: 1 addition & 0 deletions contrib/timelord/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ executable(
'timelord.c',
include_directories: root_includes,
link_with: libatalk,
c_args: dversion,
install: true,
install_dir: sbindir,
build_rpath: rpath_libdir,
Expand Down
11 changes: 10 additions & 1 deletion contrib/timelord/timelord.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ int debug = 0;
char *bad = "Bad request!";
char buf[ 4624 ];
char *server;
static char *version = VERSION;

void usage( char *p )
{
Expand Down Expand Up @@ -113,7 +114,7 @@ int main( int ac, char **av )
}
server = hostname;

while (( c = getopt( ac, av, "dln:" )) != EOF ) {
while (( c = getopt( ac, av, "dlVvn:" )) != EOF ) {
switch ( c ) {
case 'd' :
debug++;
Expand All @@ -124,6 +125,14 @@ int main( int ac, char **av )
case 'n' :
server = optarg;
break;
case 'V' :
case 'v' :
fprintf(stdout, "timelord %s - Timelord Time Server Daemon\n"
"Copyright (c) 1990,1992 Regents of The University of Michigan.\n"
"\tAll Rights Reserved.\n"
"Copyright (c) 1990, The University of Melbourne.\n", version );
exit ( 1 );
break;
default :
fprintf( stderr, "Unknown option -- '%c'\n", c );
usage( *av );
Expand Down
10 changes: 10 additions & 0 deletions doc/ja/manpages/man8/a2boot.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
<arg choice="opt">-d</arg>

<arg choice="opt">-n <replaceable>nbpname</replaceable></arg>

<arg choice="opt">-v</arg>
</cmdsynopsis>
</refsynopsisdiv>

Expand Down Expand Up @@ -79,6 +81,14 @@
として登録します。デフォルトではホスト名になります。</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-v</term>

<listitem>
<para>バージョン情報を出力して終了します。</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

Expand Down
4 changes: 2 additions & 2 deletions doc/ja/manpages/man8/macipgw.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<arg>-z <replaceable>zone</replaceable></arg>

<arg>-V</arg>
<arg>-v</arg>

<arg choice="plain"><replaceable>network</replaceable></arg>

Expand Down Expand Up @@ -112,7 +112,7 @@
</varlistentry>

<varlistentry>
<term>-V</term>
<term>-v</term>

<listitem>
<para>バージョン情報を表示して終了します。</para>
Expand Down
10 changes: 10 additions & 0 deletions doc/ja/manpages/man8/papd.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
<arg>-p printcap</arg>

<arg>-P pidfile</arg>

<arg>-v</arg>
</cmdsynopsis>
</refsynopsisdiv>

Expand Down Expand Up @@ -110,6 +112,14 @@
<para><command>papd</command> がプロセス ID を保存するファイルを指定します。</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-v</term>

<listitem>
<para>バージョン情報を出力して終了します。</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

Expand Down
10 changes: 10 additions & 0 deletions doc/ja/manpages/man8/timelord.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
<arg choice="opt">-l</arg>

<arg choice="opt">-n <replaceable>nbpname</replaceable></arg>

<arg choice="opt">-v</arg>
</cmdsynopsis>
</refsynopsisdiv>

Expand Down Expand Up @@ -75,6 +77,14 @@
として登録します。デフォルトではホスト名になります。</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-v</term>

<listitem>
<para>バージョン情報を出力して終了します。</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

Expand Down
10 changes: 10 additions & 0 deletions doc/manpages/man8/a2boot.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
<arg choice="opt">-d</arg>

<arg choice="opt">-n <replaceable>nbpname</replaceable></arg>

<arg choice="opt">-v</arg>
</cmdsynopsis>
</refsynopsisdiv>

Expand Down Expand Up @@ -80,6 +82,14 @@
remap="I">nbpname</emphasis>. This defaults to the hostname.</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-v</term>

<listitem>
<para>Print version information and exit.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

Expand Down
4 changes: 2 additions & 2 deletions doc/manpages/man8/macipgw.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<arg>-z <replaceable>zone</replaceable></arg>

<arg>-V</arg>
<arg>-v</arg>

<arg choice="plain"><replaceable>network</replaceable></arg>

Expand Down Expand Up @@ -118,7 +118,7 @@
</varlistentry>

<varlistentry>
<term>-V</term>
<term>-v</term>

<listitem>
<para>Show version information and exit.</para>
Expand Down
10 changes: 10 additions & 0 deletions doc/manpages/man8/papd.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
<arg>-p printcap</arg>

<arg>-P pidfile</arg>

<arg>-v</arg>
</cmdsynopsis>
</refsynopsisdiv>

Expand Down Expand Up @@ -116,6 +118,14 @@
process id.</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-v</term>

<listitem>
<para>Print version information and exit.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

Expand Down
10 changes: 10 additions & 0 deletions doc/manpages/man8/timelord.8.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
<arg choice="opt">-l</arg>

<arg choice="opt">-n <replaceable>nbpname</replaceable></arg>

<arg choice="opt">-v</arg>
</cmdsynopsis>
</refsynopsisdiv>

Expand Down Expand Up @@ -76,6 +78,14 @@
remap="I">nbpname</emphasis>. This defaults to the hostname.</para>
</listitem>
</varlistentry>

<varlistentry>
<term>-v</term>

<listitem>
<para>Print version information and exit.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

Expand Down
5 changes: 3 additions & 2 deletions etc/atalkd/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ int main( int ac, char **av)
socklen_t fromlen;
char *prog;

while (( c = getopt( ac, av, "12df:P:tv" )) != EOF ) {
while (( c = getopt( ac, av, "12dtVvf:P:" )) != EOF ) {
switch ( c ) {
case '1' :
defphase = IFACE_PHASE1;
Expand All @@ -844,8 +844,9 @@ int main( int ac, char **av)
transition++;
break;

case 'V' :
case 'v' : /* version */
printf( "atalkd (version %s)\n", version );
printf( "atalkd %s - AppleTalk Network Manager Daemon\n", version );
exit ( 1 );
break;

Expand Down
7 changes: 4 additions & 3 deletions etc/papd/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

#ifdef HAVE_CONFIG_H
#include <config.h>
#include "config.h"
#endif /* HAVE_CONFIG_H */

#include <string.h>
Expand Down Expand Up @@ -203,7 +203,7 @@ int main(int ac, char **av)
defprinter.p_pagecost_msg = NULL;
defprinter.p_lock = "lock";

while (( c = getopt( ac, av, "adf:p:P:v" )) != EOF ) {
while (( c = getopt( ac, av, "adVvf:p:P:" )) != EOF ) {
switch ( c ) {
case 'a' : /* for compatibility with old papd */
break;
Expand All @@ -224,8 +224,9 @@ int main(int ac, char **av)
pidfile = optarg;
break;

case 'V' :
case 'v' : /* version */
printf( "papd (version %s)\n", VERSION );
printf( "papd %s - Printer Access Protocol Daemon\n", version );
exit ( 1 );
break;

Expand Down

0 comments on commit daaa188

Please sign in to comment.