Merge pull request #894 from belisarius222/flag-non-localhost

Flag non localhost
This commit is contained in:
cgyarvin 2017-10-30 17:54:43 -07:00 committed by GitHub
commit 9a6c3b2832
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 12 deletions

View File

@ -547,8 +547,8 @@
c3_o fog; // -X, skip last event c3_o fog; // -X, skip last event
c3_o gab; // -g, run with garbage collector c3_o gab; // -g, run with garbage collector
c3_o git; // -s, pill url from arvo git hash c3_o git; // -s, pill url from arvo git hash
c3_o loh; // -L, local-only networking
c3_o mem; // -M, memory madness c3_o mem; // -M, memory madness
c3_o net; // -N, remote networking in -F mode
c3_o nuu; // -c, new pier c3_o nuu; // -c, new pier
c3_o pro; // -P, profile c3_o pro; // -P, profile
c3_o qui; // -q, quiet c3_o qui; // -q, quiet

View File

@ -50,8 +50,9 @@ _ames_czar(c3_y imp_y, c3_s* por_s)
{ {
u3_ames* sam_u = &u3_Host.sam_u; u3_ames* sam_u = &u3_Host.sam_u;
if ( c3y == u3_Host.ops_u.loh ) { if ( c3n == u3_Host.ops_u.net ) {
*por_s = 31337 + imp_y; *por_s = 31337 + imp_y;
uL(fprintf(uH, "ames: czar: localhost-only mode\n"));
return 0x7f000001; return 0x7f000001;
} }
else { else {

View File

@ -73,7 +73,7 @@ _main_getopt(c3_i argc, c3_c** argv)
u3_Host.ops_u.fog = c3n; u3_Host.ops_u.fog = c3n;
u3_Host.ops_u.gab = c3n; u3_Host.ops_u.gab = c3n;
u3_Host.ops_u.git = c3n; u3_Host.ops_u.git = c3n;
u3_Host.ops_u.loh = c3n; u3_Host.ops_u.net = c3n;
u3_Host.ops_u.mem = c3n; u3_Host.ops_u.mem = c3n;
u3_Host.ops_u.nuu = c3n; u3_Host.ops_u.nuu = c3n;
u3_Host.ops_u.pro = c3n; u3_Host.ops_u.pro = c3n;
@ -83,7 +83,7 @@ _main_getopt(c3_i argc, c3_c** argv)
u3_Host.ops_u.veb = c3n; u3_Host.ops_u.veb = c3n;
u3_Host.ops_u.kno_w = DefaultKernel; u3_Host.ops_u.kno_w = DefaultKernel;
while ( (ch_i=getopt(argc, argv,"G:B:A:I:w:u:t:f:k:l:n:p:r:LabcdgqsvxFMPDXR")) != -1 ) { while ( (ch_i=getopt(argc, argv,"G:B:A:I:w:u:t:f:k:l:n:p:r:NabcdgqsvxFMPDXR")) != -1 ) {
switch ( ch_i ) { switch ( ch_i ) {
case 'M': { case 'M': {
u3_Host.ops_u.mem = c3y; u3_Host.ops_u.mem = c3y;
@ -162,12 +162,8 @@ _main_getopt(c3_i argc, c3_c** argv)
u3_Host.ops_u.rep = c3y; u3_Host.ops_u.rep = c3y;
return c3y; return c3y;
} }
case 'L': { u3_Host.ops_u.loh = c3y; break; } case 'N': { u3_Host.ops_u.net = c3y; break; }
case 'F': { case 'F': { u3_Host.ops_u.fak = c3y; break; }
u3_Host.ops_u.loh = c3y;
u3_Host.ops_u.fak = c3y;
break;
}
case 'a': { u3_Host.ops_u.abo = c3y; break; } case 'a': { u3_Host.ops_u.abo = c3y; break; }
case 'b': { u3_Host.ops_u.bat = c3y; break; } case 'b': { u3_Host.ops_u.bat = c3y; break; }
case 'c': { u3_Host.ops_u.nuu = c3y; break; } case 'c': { u3_Host.ops_u.nuu = c3y; break; }
@ -184,6 +180,13 @@ _main_getopt(c3_i argc, c3_c** argv)
} }
} }
if ( u3_Host.ops_u.fak == c3n && u3_Host.ops_u.net == c3y ) {
fprintf(stderr, "-N only makes sense with -F\n");
return c3n;
} else if ( u3_Host.ops_u.fak == c3n && u3_Host.ops_u.net == c3n ) {
u3_Host.ops_u.net = c3y; /* remote networking is always on in real mode. */
}
if ( u3_Host.ops_u.arv_c != 0 && ( u3_Host.ops_u.imp_c == 0 || if ( u3_Host.ops_u.arv_c != 0 && ( u3_Host.ops_u.imp_c == 0 ||
u3_Host.ops_u.nuu == c3n ) ) { u3_Host.ops_u.nuu == c3n ) ) {
fprintf(stderr, "-A only makes sense when creating a new galaxy\n"); fprintf(stderr, "-A only makes sense when creating a new galaxy\n");
@ -197,13 +200,13 @@ _main_getopt(c3_i argc, c3_c** argv)
"the initial sync path with -A\n"); "the initial sync path with -A\n");
return c3n; return c3n;
} }
if ( u3_Host.ops_u.gen_c != 0 && ( u3_Host.ops_u.imp_c == 0 || if ( u3_Host.ops_u.gen_c != 0 && ( u3_Host.ops_u.imp_c == 0 ||
u3_Host.ops_u.nuu == c3n ) ) { u3_Host.ops_u.nuu == c3n ) ) {
fprintf(stderr, "-G only makes sense when creating a new galaxy\n"); fprintf(stderr, "-G only makes sense when creating a new galaxy\n");
return c3n; return c3n;
} }
if ( u3_Host.ops_u.tic_c != 0 && ( u3_Host.ops_u.imp_c != 0 || if ( u3_Host.ops_u.tic_c != 0 && ( u3_Host.ops_u.imp_c != 0 ||
u3_Host.ops_u.nuu == c3n ) ) { u3_Host.ops_u.nuu == c3n ) ) {
fprintf(stderr, "-t only makes sense when creating a new non-galaxy\n"); fprintf(stderr, "-t only makes sense when creating a new non-galaxy\n");