From 1d8d623c9d147ec3567ffb07fccdc3ddedc40241 Mon Sep 17 00:00:00 2001 From: erickson Date: Tue, 1 Mar 2005 23:56:11 +0000 Subject: [PATCH] removed the command line login requirement and now we just us the transport connection build by bootstrap_client git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@146 9efc2488-bf62-4759-914b-345cdb29e865 --- src/srfsh/srfsh.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/srfsh/srfsh.c b/src/srfsh/srfsh.c index fa3043e..99bbcc0 100644 --- a/src/srfsh/srfsh.c +++ b/src/srfsh/srfsh.c @@ -27,25 +27,21 @@ char* tabs(int count); int main( int argc, char* argv[] ) { - if( argc < 5 ) - fatal_handler( "usage: %s ", argv[0] ); + if( argc < 2 ) + fatal_handler( "usage: %s ", argv[0] ); - config_reader_init( "opensrf", argv[4] ); + config_reader_init( "opensrf", argv[1] ); char request[256]; memset(request, 0, 256); printf(prompt); - client = client_init( argv[1], SRFSH_PORT, 0 ); - if( ! client_connect( client, argv[2], argv[3], "srfsh", 5, AUTH_DIGEST ) ) { - fprintf(stderr, "Unable to connect to jabber server '%s' as '%s'\n", argv[1], argv[2]); - fprintf(stderr, "Most queries will be futile...\n" ); - } - if( ! osrf_system_bootstrap_client("srfsh.xml") ) fprintf( stderr, "Unable to bootstrap client for requests\n"); + client = osrf_system_get_transport_client(); + while( fgets( request, 255, stdin) ) { // remove newline @@ -85,7 +81,7 @@ int main( int argc, char* argv[] ) { free(req_copy); } - fprintf(stderr, "Exiting...\n[Ignore Segfault]\n"); + fprintf(stderr, "Exiting...\n[Ignore Segfault :)]\n"); config_reader_free(); log_free(); -- 2.11.0