                 break
             case "-l", "--language":
                 languageAware = true
+                var langs = Locale.preferredLanguages.map { (l) -> String in
+                    if l.contains("-") {
+                        // Locale always produces country-specific subtags,
+                        // but the DWIM expectation is probably to use just
+                        // the language code
+                        return String(l.prefix { $0 != "-" })
+                    } else {
+                        return l
+                    }
+                }
+                langs.append("*")
+                
+                let q = (1...langs.count).reversed()
+                    .map { Double($0)/Double(langs.count) }
+                    .map { (v: Double) -> Double in Double(Int(v*100.0))/100.0 }
+                acceptLanguages = Array(zip(langs, q))
             case "-d":
                 defaultGraphs.append(args.remove(at: index))
+            case _ where arg.hasPrefix("--language="):
+                languageAware = true
+                let langs = String(arg.dropFirst(11)).split(separator: ",").map { String($0) }
+                let q = (1...langs.count).reversed()
+                    .map { Double($0)/Double(langs.count) }
+                    .map { (v: Double) -> Double in Double(Int(v*100.0))/100.0 }
+                acceptLanguages = Array(zip(langs, q))
             case _ where arg.hasPrefix("--default-graph="):
                 defaultGraphs.append(String(arg.dropFirst(16)))
             case "-n":

            let named = Dictionary(uniqueKeysWithValues: namedGraphs.map { (Term(iri: $0), $0) })
            initialize = .loadFiles(default: defaultGraphs, named: named)
        }
        
        self.init(
            type: type,
            initialize: initialize,
            languageAware: languageAware
        )
    }

    public func withStore(_ handler: (QuadStoreProtocol) throws -> ()) throws {
        switch type {
        case .sqliteFileDatabase(let filename):
            let store = try SQLiteQuadStore(filename: filename)
            if languageAware {
                let acceptLanguages = [("*", 1.0)] // can be changed later
                let lstore = SQLiteLanguageQuadStore(quadstore: store, acceptLanguages: acceptLanguages)
                try handler(lstore)
            } else {

                let filename = String(arg.dropFirst(7))
                type = .sqliteFileDatabase(filename)
            default:
                args.insert(arg, at: index)
                break LOOP
            }
        }
