/*
 * Copyright (c) 2009-2013 Topi Nieminen
 */
package fi.tnie.dbmeta.tools;

import fi.tnie.db.expr.Identifier;
import fi.tnie.util.cli.Parser;

public class CatalogInfo
    extends CatalogTool {
        
    /**
     * @param args
     */
    public static void main(String[] args) {        
        System.exit(new CatalogInfo().run(args));
    }
    
    @Override
    public void run() {
        Identifier n = getCatalog().getName();
        String cat = (n == null) ? null : n.getName();        
        message("Catalog loaded: " + ((cat == null) ? "<unnamed>" : cat));
    }
    
    @Override
    protected void prepare(Parser p) {        
        super.prepare(p);
        addOption(p, OPTION_VERBOSE);        
    }
}

@@ -107,16 +107,81 @@
 tifier;%0A
+import fi.tnie.db.meta.Schema;%0Aimport fi.tnie.db.meta.SchemaMap;%0A
 import f
@@ -204,16 +204,16 @@
 Parser;%0A
-
 %0Apublic 
@@ -553,24 +553,16 @@
 tName();
-        
 %0A       
@@ -625,24 +625,311 @@
 %3E%22 : cat));%0A
+        %0A        SchemaMap sm = getCatalog().schemas();%0A        %0A        message(%22schemas (%22 + sm.values().size() + %22) %7B%22);%0A        %0A        for (Schema s : sm.values()) %7B%0A        %09message(s.getUnqualifiedName().getName());        %09%09%0A%09%09%7D%0A        %0A        message(%22%7D%22);%0A        %0A        %0A
     %7D%0A    %0A 

Add listing of schemas into CatalogInfo