         var printAlgebra = false
         var printSPARQL = false
         var pretty = true
-        if let next = args.peek(), next == "-s" {
+        if let next = args.peek(), next.lowercased() == "-s" {
             _ = args.next()
             printSPARQL = true
+            if next == "-S" {
+                pretty = true
+            }
         }
         if let next = args.peek(), next == "-a" {
             _ = args.next()

    var count       = 0
    let startTime = getCurrentTime()
    try database.read { (m) in
        let store       = try LanguageQuadStore(mediator: m, acceptLanguages: [("en", 1.0), ("", 0.5)])
        //            let store       = try QuadStore(mediator: m)
        
        var defaultGraph: Term
        if let g = graph {
            defaultGraph = g

    print("- explaining query")
    try database.read { (m) in
        print("- mediator: \(m)")
//        let store       = try LanguageQuadStore(mediator: m, acceptLanguages: [("en", 1.0), ("", 0.5)])
        let store       = try QuadStore(mediator: m)
        print("- store: \(store)")
        var defaultGraph: Term
        if let g = graph {
