inthefabric / RexConnect

Connect to Rexster/RexPro via TCP connection.
www.inthefabric.com
Other
10 stars 0 forks source link

Console Syntax Highlighting #5

Closed zachkinstner closed 11 years ago

zachkinstner commented 11 years ago

When posting console output, it would be nice to see things with colors/highlights. Experiment!

zachkinstner commented 11 years ago

C:

" RexConn> test
"what
'apso
' apos
#no space
!test
/* hmm
hmm
/* more */
-- double
- single
== doubleeq
= singleeq
~ tilde
{ open
[ open
+ plus
++ pluss
/** moreplus **/
"comm
x"
" comment
x"
//comm
// comment
: colon
:: doublecol
; semi
;; dblsemi
? ques
?? dq
/ slash
after / what
// dblslash
> arr
>> da
< in
<< di
. dot
.. dd
* star
** ds
data
` tick
zachkinstner commented 11 years ago

Ruby:

" RexConn> test
"what
'apso
' apos
#no space
!test
/* hmm
hmm
/* more */
-- double
- single
== doubleeq
= singleeq
~ tilde
{ open
[ open
+ plus
++ pluss
/** moreplus **/
"comm
x"
" comment
x"
//comm
// comment
: colon
:: doublecol
; semi
;; dblsemi
? ques
?? dq
/ slash
after / what
// dblslash
> arr
>> da
< in
<< di
. dot
.. dd
* star
** ds
data
` tick
zachkinstner commented 11 years ago

PHP:

" RexConn> test
"what
'apso
' apos
#no space
!test
/* hmm
hmm
/* more */
-- double
- single
== doubleeq
= singleeq
~ tilde
{ open
[ open
+ plus
++ pluss
/** moreplus **/
"comm
x"
" comment
x"
//comm
// comment
: colon
:: doublecol
; semi
;; dblsemi
? ques
?? dq
/ slash
after / what
// dblslash
> arr
>> da
< in
<< di
. dot
.. dd
* star
** ds
data
` tick
zachkinstner commented 11 years ago

TCSH:

" RexConn> test
"what
'apso
' apos
#no space
!test
/* hmm
hmm
/* more */
-- double
- single
== doubleeq
= singleeq
~ tilde
{ open
[ open
+ plus
++ pluss
/** moreplus **/
"comm
x"
" comment
x"
//comm
// comment
: colon
:: doublecol
; semi
;; dblsemi
? ques
?? dq
/ slash
after / what
// dblslash
> arr
>> da
< in
<< di
. dot
.. dd
* star
** ds
data
` tick
zachkinstner commented 11 years ago

C v1:

$ bin/rexConnectConsole.sh

"           ---===##\    
"               --==##\  
" ---===################>
"               --==##/  
"           ---===##/    

RexConnect Console 0.3.0
{rexpro_port=8184, rexpro_graph_name=Fabric, rexconnect_port=8184, rexpro_hosts=rexster, rexpro_timeout_ms=120000}

-------------------------------------------------------------

# RexConnect> query
#  - script (arg #0; string): g
#  - params (arg #1; string; optional): 
// Debug information...

{
    "timer": 598, 
    "result": [
        "titangraph[local:data/Fabric]"
    ]
}
zachkinstner commented 11 years ago

Ruby v1:

$ bin/rexConnectConsole.sh
'
          ---===##\    
              --==##\  
---===################>
              --==##/  
          ---===##/    
'
RexConnect Console 0.3.0
{rexpro_port=8184, rexpro_graph_name=Fabric, rexconnect_port=8184, rexpro_hosts=rexster, rexpro_timeout_ms=120000}

-------------------------------------------------------------
/
RexConnect> query
  - script (arg #0; string): g
  - params (arg #1; string; optional): 
/
# Debug information...

{
    "timer": 598, 
    "result": [
        "titangraph[local:data/Fabric]"
    ]
}
zachkinstner commented 11 years ago

PHP v1:

$ bin/rexConnectConsole.sh
'
          ---===##\    
              --==##\  
---===################>
              --==##/  
          ---===##/    
'
RexConnect Console 0.3.0
{rexpro_port=8184, rexpro_graph_name=Fabric, rexconnect_port=8184, rexpro_hosts=rexster, rexpro_timeout_ms=120000}

-------------------------------------------------------------

:: RexConnect> query
::   script (arg 0; string): g
::   params (arg 1; string; optional): 
// Debug information...

{
    "timer": 598, 
    "result": [
        "titangraph[local:data/Fabric]"
    ]
}
zachkinstner commented 11 years ago

Lengthy console output with "C" markup:


"            ---===##\    
"                --==##\  
"  ---===################>
"                --==##/  
"            ---===##/    

RexConnect Console 0.3.0
{rexpro_port=8184, rexpro_graph_name=Fabric, rexconnect_port=8184, rexpro_hosts=rexster, rexpro_timeout_ms=120000}

-------------------------------------------------------------

# RexConnect> config
#   ...setting (0; string): pretty
#   ...mode (1; int): 1

{
    "timer": 0
}

# RexConnect> query
#   ...script (0; string): g
#   ...params (1; string; opt): 

{
    "timer": 579, 
    "result": [
        "titangraph[local:data/Fabric]"
    ]
}

# RexConnect> query
#   ...script (0; string): g.V
#   ...params (1; string; opt): 

{
    "timer": 22, 
    "result": [
        {
            "_properties": {
                "Testing": 123
            }, 
            "_id": "40004", 
            "_type": "vertex"
        }, 
        {
            "_properties": {
                "Testing": 345
            }, 
            "_id": "40008", 
            "_type": "vertex"
        }, 
        {
            "_properties": {
                "Prop3": "hijkl", 
                "Prop2": "defg", 
                "Prop1": "abc"
            }, 
            "_id": "40012", 
            "_type": "vertex"
        }
    ]
}

# RexConnect> session
#   ...action (0; string): start

{
    "timer": 42, 
    "result": "84c8fa51-2050-404b-af0b-d132b7bc1b11"
}

# RexConnect> x=123

{
    "timer": 0, 
    "err": "Unknown command 'x=123'."
}

# RexConnect> query
#   ...script (0; string): x=1234
#   ...params (1; string; opt): 

{
    "timer": 35, 
    "result": [
        1234
    ]
}

# RexConnect> query
#   ...script (0; string): y=P0
#   ...params (1; string; opt): {"P0":9876}

{
    "timer": 402, 
    "result": [
        9876
    ]
}

# RexConnect> query
#   ...script (0; string): [x,y]
#   ...params (1; string; opt): 

{
    "timer": 7, 
    "result": [
        1234, 
        9876
    ]
}

# RexConnect> query
#   ...script (0; string): x*y
#   ...params (1; string; opt): 

{
    "timer": 7, 
    "result": [
        12186984
    ]
}

# RexConnect> query
#   ...script (0; string): x*y-P0
#   ...params (1; string; opt): {"P0":6984}

{
    "timer": 541, 
    "result": [
        12180000
    ]
}

# RexConnect> session
#   ...action (0; string): close

{
    "timer": 6
}

# RexConnect> query
#   ...script (0; string): g
#   ...params (1; string; opt): 

{
    "timer": 7, 
    "result": [
        "titangraph[local:data/Fabric]"
    ]
}

# RexConnect> 
zachkinstner commented 11 years ago

A console session with debugging:

"            ---===##\    
"                --==##\  
"  ---===################>
"                --==##/  
"            ---===##/    

RexConnect Console 0.3.0
{rexpro_port=8184, rexpro_graph_name=Fabric, rexconnect_port=8184, rexpro_hosts=rexster, rexpro_timeout_ms=120000}

-------------------------------------------------------------

# RexConnect> config
#   ...setting (0; string): debug
#   ...mode (1; int): 1

{"timer":0}

# RexConnect> query
#   ...script (0; string): g
#   ...params (1; string; opt): 

// Request: com.tinkerpop.rexster.protocol.msg.ScriptRequestMessage
// Response: com.tinkerpop.rexster.protocol.msg.MsgPackScriptResponseMessage
{"timer":617,"result":["titangraph[local:data/Fabric]"]}

# RexConnect> session
#   ...action (0; string): start

// Request: com.tinkerpop.rexster.protocol.msg.SessionRequestMessage; Session=2fa70678-08f3-4d67-a2ae-2cf10439ecca
// Response: com.tinkerpop.rexster.protocol.msg.SessionResponseMessage; Session=ac933cda-73be-42c4-997c-7e6a5374d739
{"timer":45,"result":"ac933cda-73be-42c4-997c-7e6a5374d739"}

# RexConnect> query
#   ...script (0; string): g.V.count()
#   ...params (1; string; opt): 

// Request: com.tinkerpop.rexster.protocol.msg.ScriptRequestMessage; Session=ac933cda-73be-42c4-997c-7e6a5374d739
// Response: com.tinkerpop.rexster.protocol.msg.MsgPackScriptResponseMessage; Session=ac933cda-73be-42c4-997c-7e6a5374d739
{"timer":415,"result":[3]}

# RexConnect> query
#   ...script (0; string): [g.V.count(), g.E.count()]
#   ...params (1; string; opt): 

// Request: com.tinkerpop.rexster.protocol.msg.ScriptRequestMessage; Session=ac933cda-73be-42c4-997c-7e6a5374d739
// Response: com.tinkerpop.rexster.protocol.msg.MsgPackScriptResponseMessage; Session=ac933cda-73be-42c4-997c-7e6a5374d739
{"timer":683,"result":[3,0]}

# RexConnect> session
#   ...action (0; string): rollback

// Request: com.tinkerpop.rexster.protocol.msg.ScriptRequestMessage; Session=ac933cda-73be-42c4-997c-7e6a5374d739
// Response: com.tinkerpop.rexster.protocol.msg.MsgPackScriptResponseMessage; Session=ac933cda-73be-42c4-997c-7e6a5374d739
{"timer":32}

# RexConnect> session
#   ...action (0; string): close

// Request: com.tinkerpop.rexster.protocol.msg.SessionRequestMessage; Session=9fd90cd7-238b-452f-9c27-5750ab00ca0b
// Response: com.tinkerpop.rexster.protocol.msg.SessionResponseMessage
{"timer":10}

# RexConnect>