Don't show aliases for layer names when invoked with "synfig --layers".
[synfig.git] / synfig-core / trunk / src / tool / main.cpp
index 22f5a98..64ac382 100644 (file)
@@ -6,7 +6,7 @@
 **
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
-**     Copyright (c) 2007 Chris Moore
+**     Copyright (c) 2007, 2008 Chris Moore
 **
 **     This package is free software; you can redistribute it and/or
 **     modify it under the terms of the GNU General Public License as
@@ -404,7 +404,8 @@ int process_global_flags(arg_list_t &arg_list)
                        synfig::Main synfig_main(dirname(progname),&p);
                        synfig::Layer::Book::iterator iter=synfig::Layer::book().begin();
                        for(;iter!=synfig::Layer::book().end();iter++)
-                               cout<<iter->first<<endl;
+                               if (iter->second.category != CATEGORY_DO_NOT_USE)
+                                       cout<<iter->first<<endl;
 
                        return SYNFIGTOOL_HELP;
                }
@@ -960,9 +961,25 @@ int main(int argc, char *argv[])
                                string ext = filename_extension(job_list.front().outfilename);
                                if (ext.length()) ext = ext.substr(1);
                                if(Target::ext_book().count(ext))
+                               {
                                        target_name=Target::ext_book()[ext];
+                                       info("target name not specified - using %s", target_name.c_str());
+                               }
                                else
-                                       target_name=ext;
+                               {
+                                       string lower_ext(ext);
+
+                                       for(unsigned int i=0;i<ext.length();i++)
+                                               lower_ext[i] = tolower(ext[i]);
+
+                                       if(Target::ext_book().count(lower_ext))
+                                       {
+                                               target_name=Target::ext_book()[lower_ext];
+                                               info("target name not specified - using %s", target_name.c_str());
+                                       }
+                                       else
+                                               target_name=ext;
+                               }
                        }
 
                        // If the target type is STILL not yet defined, then