fsetupcmd got -l option
This commit is contained in:
parent
a241a9f1d6
commit
588f449894
|
|
@ -30,6 +30,8 @@ Version NEXT
|
||||||
fsetupcmd - reject port number > 65535
|
fsetupcmd - reject port number > 65535
|
||||||
fsetupcmd - code cleaned a bit. Error message is now
|
fsetupcmd - code cleaned a bit. Error message is now
|
||||||
fsetup: No host given! instead of fhost:
|
fsetup: No host given! instead of fhost:
|
||||||
|
fsetupcmd got -l option. It lists all known fsp servers collected
|
||||||
|
from .fspsites files.
|
||||||
|
|
||||||
Version 2.8.1b25 - 10 Sep 2009
|
Version 2.8.1b25 - 10 Sep 2009
|
||||||
GNU autotools build system was entirely replaced by SCons
|
GNU autotools build system was entirely replaced by SCons
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,24 @@ void list_prof_file (void) /* list resource file */
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void list_sites_file (void) /* list resource file in fspsites format */
|
||||||
|
{
|
||||||
|
int i,j;
|
||||||
|
for(i=0;i<hostsize;i++)
|
||||||
|
{
|
||||||
|
printf("%-20s%6d %-20s",(host[i].hostname?host[i].hostname : host[i].hostaddr),(host[i].port<=0? 21 : host[i].port), host[i].dir != NULL? host[i].dir : "/");
|
||||||
|
j=0;
|
||||||
|
while(host[i].alias[j])
|
||||||
|
{
|
||||||
|
printf(" %s",host[i].alias[j]);
|
||||||
|
j++;
|
||||||
|
}
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* lhost: type of FSP_HOST address NUMBER or NAME */
|
/* lhost: type of FSP_HOST address NUMBER or NAME */
|
||||||
int print_host_setup(struct fsp_host *setup,int csh,int lhost)
|
int print_host_setup(struct fsp_host *setup,int csh,int lhost)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -20,3 +20,4 @@ void add_host_alias(struct fsp_host *h, const char *name);
|
||||||
struct fsp_host *find_host(const char *name);
|
struct fsp_host *find_host(const char *name);
|
||||||
void list_prof_file (void); /* list resource file */
|
void list_prof_file (void); /* list resource file */
|
||||||
int print_host_setup(struct fsp_host *setup,int csh,int lhost);
|
int print_host_setup(struct fsp_host *setup,int csh,int lhost);
|
||||||
|
void list_sites_file(void); /* list resource file in fspsites format */
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ int sitewrap(void);
|
||||||
|
|
||||||
static void setup_usage (void) /* print usage message */
|
static void setup_usage (void) /* print usage message */
|
||||||
{
|
{
|
||||||
fprintf(stderr,"Usage: fsetup [ -b | -c ] host port [directory] | abbreviation \n");
|
fprintf(stderr,"Usage: fsetup -l | [ -b | -c ] host port [directory] | abbreviation \n");
|
||||||
exit(EX_OK);
|
exit(EX_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -84,7 +84,7 @@ int main (int argc, char ** argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
setup=init_host();
|
setup=init_host();
|
||||||
while ((optletter=getopt(argc, argv,"hbc?")) != EOF)
|
while ((optletter=getopt(argc, argv,"hbcl?")) != EOF)
|
||||||
switch (optletter) {
|
switch (optletter) {
|
||||||
case '?':
|
case '?':
|
||||||
case 'h':
|
case 'h':
|
||||||
|
|
@ -95,6 +95,10 @@ int main (int argc, char ** argv)
|
||||||
case 'c':
|
case 'c':
|
||||||
csh=1;
|
csh=1;
|
||||||
break;
|
break;
|
||||||
|
case 'l':
|
||||||
|
parse_prof_file_new();
|
||||||
|
list_sites_file();
|
||||||
|
exit(0);
|
||||||
default:
|
default:
|
||||||
setup_usage();
|
setup_usage();
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
.TH FSETUP 1 "Jan 2005" FSP
|
.TH FSETUP 1 "Sep 2009" FSP
|
||||||
.SH NAME
|
.SH NAME
|
||||||
fsetupcmd, fsetup \- set environment variables
|
fsetupcmd, fsetup \- set environment variables
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
.B fsetup [-c | -b] host port [directory] | abbreviation
|
.B fsetup -l | [-c | -b] host port [directory] | abbreviation
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
.LP
|
.LP
|
||||||
.B fsetup
|
.B fsetup
|
||||||
|
|
@ -28,6 +28,7 @@ searching in the resource file will be done.
|
||||||
Since programs cannot change environment variables of their parent shell in
|
Since programs cannot change environment variables of their parent shell in
|
||||||
a simple way, it is recommended that the user defines a shell alias or
|
a simple way, it is recommended that the user defines a shell alias or
|
||||||
function to make it possible.
|
function to make it possible.
|
||||||
|
.LP
|
||||||
.B csh
|
.B csh
|
||||||
example:
|
example:
|
||||||
.LP
|
.LP
|
||||||
|
|
@ -35,10 +36,19 @@ example:
|
||||||
alias fsetup 'eval `fsetupcmd \!*`'
|
alias fsetup 'eval `fsetupcmd \!*`'
|
||||||
.fi
|
.fi
|
||||||
.SH FILES
|
.SH FILES
|
||||||
|
.LP
|
||||||
|
~/.fspsites
|
||||||
|
.br
|
||||||
|
/etc/fspsites
|
||||||
|
|
||||||
For more information about the resource file confer
|
For more information about the resource file confer
|
||||||
.I fspsites(5).
|
.I fspsites(5).
|
||||||
.SH ARGUMENTS
|
.SH ARGUMENTS
|
||||||
.LP
|
.LP
|
||||||
|
.B -l
|
||||||
|
-- displays sites from
|
||||||
|
.I fspsites(5)
|
||||||
|
.LP
|
||||||
.B -b
|
.B -b
|
||||||
-- output Bourne shell code
|
-- output Bourne shell code
|
||||||
.LP
|
.LP
|
||||||
|
|
@ -47,11 +57,17 @@ For more information about the resource file confer
|
||||||
.SH ENVIRONMENT
|
.SH ENVIRONMENT
|
||||||
.LP
|
.LP
|
||||||
The environment variables associate this program with a FSP database and are
|
The environment variables associate this program with a FSP database and are
|
||||||
set (resp. unset) if needed. See fsp_env(7) for list.
|
set (resp. unset) if needed. See
|
||||||
|
.I fsp_env(7)
|
||||||
|
for list.
|
||||||
.SH HISTORY
|
.SH HISTORY
|
||||||
.LP
|
.LP
|
||||||
This is rewrite of classic fsetup Perl script which was used in gold
|
This program is rewrite of classic fsetup Perl script which was used in gold
|
||||||
FSP era to parse standard fspsites format used for FSP site list exchange.
|
FSP era to parse standard fspsites format used for FSP site list exchange.
|
||||||
|
It was used as replacement for
|
||||||
|
.I fsp_prof(5)
|
||||||
|
because it is much easier to use and more suitable for exchanging
|
||||||
|
lists of public fsp servers.
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
.PD
|
.PD
|
||||||
fcatcmd(1), fcdcmd(1), fgetcmd(1), fgrabcmd(1), flscmd(1), fmkdir(1),
|
fcatcmd(1), fcdcmd(1), fgetcmd(1), fgrabcmd(1), flscmd(1), fmkdir(1),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user