slimmed a chunk of code
authorerickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 20 Apr 2005 20:48:50 +0000 (20:48 +0000)
committererickson <erickson@9efc2488-bf62-4759-914b-345cdb29e865>
Wed, 20 Apr 2005 20:48:50 +0000 (20:48 +0000)
git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@289 9efc2488-bf62-4759-914b-345cdb29e865

src/srfsh/srfsh.c

index e24e5b3..8594fd1 100644 (file)
@@ -32,11 +32,11 @@ int main( int argc, char* argv[] ) {
 
 
        client = osrf_system_get_transport_client();
+       osrf_message_set_json_parse(1);
 
 
        /* main process loop */
        char* request;
-       //signal(SIGINT,sig_int_handler);
        while((request=readline(prompt))) {
 
                if( !strcmp(request, "exit") || !strcmp(request,"quit")) 
@@ -461,18 +461,17 @@ int send_request( char* server,
                        osrf_message_free(last_result);
                        last_result = omsg;
 
-                       if( pretty_print ) {
-                               char* content = json_printer( omsg->result_content );
-                               buffer_add( resp_buffer, "\nReceived Data: " ); 
-                               buffer_add( resp_buffer, content );
-                               buffer_add( resp_buffer, "\n" );
-                               free(content);
-                       } else {
-                               char* content = json_object_get_string(omsg->result_content);
-                                       buffer_add( resp_buffer, "\nReceived Data: " ); 
-                                       buffer_add( resp_buffer, content );
-                                       buffer_add( resp_buffer, "\n" );
-                       }
+                       char* content;
+
+                       if( pretty_print ) 
+                               content = json_printer( omsg->result_content );
+                       else
+                               content = json_object_get_string(omsg->result_content);
+
+                       buffer_add( resp_buffer, "\nReceived Data: " ); 
+                       buffer_add( resp_buffer, content );
+                       buffer_add( resp_buffer, "\n" );
+                       free(content);
 
                } else {
 
@@ -492,7 +491,6 @@ int send_request( char* server,
 
        }
 
-
        double end = get_timestamp_millis();
 
        fprintf( less, resp_buffer->buf );