Commit eda1ce0c authored by Niels Möller's avatar Niels Möller
Browse files

* src/sftp/sftp-test-client.c: Added dummy functions do_ls,

do_get, do_put and do_stat, and call them from main.

Rev: src/sftp/sftp-test-client.c:1.2
parent 2226927f
......@@ -105,17 +105,60 @@ client_handshake(struct client_ctx *ctx)
&& (version == SFTP_VERSION)
&& sftp_get_eod(ctx->i));
}
int main(int argc, char **argv)
static void
do_ls(struct client_ctx *ctx, const char *name)
{
}
static void
do_get(struct client_ctx *ctx, const char *name)
{
}
static void
do_put(struct client_ctx *ctx, const char *name)
{
}
static void
do_stat(struct client_ctx *ctx, const char *name)
{
}
int
main(int argc, char **argv)
{
struct client_ctx ctx;
if (argc != 2)
FATAL("Bad args.");
int i;
if (argc < 2)
FATAL("Too few args.");
fork_server(argv[1], &ctx);
if (!client_handshake(&ctx))
FATAL("Handshake failed.");
for (i = 2; i < argc; i += 2)
switch (argv[i][0])
{
case 'l': /* ls */
/* Depends on argv[argc] == NULL */
do_ls(&ctx, argv[i+1]);
break;
case 'g': /* get */
do_get(&ctx, argv[i+1]);
break;
case 'p':
do_put(&ctx, argv[i+1]);
break;
case 's':
do_stat(&ctx, argv[i+1]);
break;
default:
FATAL("Bad arg");
}
return EXIT_SUCCESS;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment