52 "Usage: plpftp [OPTIONS]... [FTPCOMMAND]\n"
54 "If FTPCOMMAND is given, connect; run FTPCOMMAND and\n"
55 "terminate afterwards. If no FTPCOMMAND is given, start up\n"
56 "in interactive mode. For help on supported FTPCOMMANDs,\n"
57 "use `?' or `help' as FTPCOMMAND.\n"
59 "Supported options:\n"
61 " -h, --help Display this text.\n"
62 " -V, --version Print version and exit.\n"
63 " -p, --port=[HOST:]PORT Connect to port PORT on host HOST.\n"
64 " Default for HOST is 127.0.0.1\n"
65 " Default for PORT is "
71 cerr <<
_(
"Try `plpftp --help' for more information") << endl;
74static struct option
opts[] = {
75 {
"help", no_argument,
nullptr,
'h'},
76 {
"version", no_argument,
nullptr,
'V'},
77 {
"port", required_argument,
nullptr,
'p'},
78 {NULL, 0,
nullptr, 0 }
84 cout <<
_(
"PLPFTP Version ") << VERSION;
85 cout <<
_(
" Copyright (C) 1999 Philip Proudman") << endl;
86 cout <<
_(
" Additions Copyright (C) 1999-2002 Fritz Elfert <felfert@to.com>") << endl;
87 cout <<
_(
" & (C) 1999 Matt Gumbley <matt@gumbley.demon.co.uk>") << endl;
88 cout <<
_(
" & (C) 2006-2025 Reuben Thomas <rrt@sc3d.org>") << endl;
89 cout <<
_(
"PLPFTP comes with ABSOLUTELY NO WARRANTY.") << endl;
90 cout <<
_(
"This is free software, and you are welcome to redistribute it") << endl;
91 cout <<
_(
"under GPL conditions; see the COPYING file in the distribution.") << endl;
93 cout <<
_(
"FTP like interface started. Type \"?\" for help.") << endl;
106 string host =
"127.0.0.1";
110 setlocale (LC_ALL,
"");
114 int c = getopt_long(argc, argv,
"hVp:",
opts, NULL);
122 cout <<
_(
"plpftp Version ") << VERSION << endl;
129 cout <<
_(
"Invalid port definition.") << endl;
139 if (!skt->
connect(host.c_str(), sockNum)) {
140 cout <<
_(
"plpftp: could not connect to ncpd") << endl;
144 if (!skt2->
connect(host.c_str(), sockNum)) {
145 cout <<
_(
"plpftp: could not connect to ncpd") << endl;
153 rclipSocket->
connect(NULL, sockNum);
155 rc =
new rclip(rclipSocket);
156 f.
canClip = rclipSocket && rc ? true :
false;
157 if ((
a != NULL) && (
r != NULL)) {
158 vector<char *> args(argv + optind, argv + argc);
159 status = f.
session(*
a, *
r, *rc, *rclipSocket, args);
A class for dealing with sockets.
virtual bool connect(const char *const Peer, int PeerPort, const char *const Host=NULL, int HostPort=0)
Connects to a given host.
int session(rfsv &a, rpcs &r, rclip &rc, TCPSocket &rclipSocket, std::vector< char * > argv)
Remote ClipBoard services via PLP.
Access remote file services of a Psion.
A factory for automatically instantiating the correct rfsv protocol variant depending on the connecte...
virtual Enum< errs > getError()
Retrieve an error code.
virtual rfsv * create(bool)
Creates a new rfsv instance.
Remote procedure call services via PLP.
A factory for automatically instantiating the correct protocol variant depending on the connected Psi...
virtual rpcs * create(bool reconnect)
Creates a new rpcs instance.
bool parse_port(const std::string &arg, std::string *host, int *port)
int lookup_default_port()
int main(int argc, char **argv)
static struct option opts[]
#define textdomain(Domain)