+if selections.get_bool("list"):
+ print( weather.list_aliases(selections.config) )
+
+# this mode lists details of aliases defined in the config
+elif selections.get_bool("longlist"):
+ print( weather.list_aliases(selections.config, detail=True) )
+
+# this mode builds the correlation data files
+elif selections.get_bool("build_sets"):
+ weather.correlate()
+
+# if no arguments were provided
+elif not selections.arguments:
+ import sys
+
+ # substitute defaults if we have any
+ if selections.config.has_option("default", "defargs"):
+ sys.argv += selections.config.get("default", "defargs").split(",")
+ selections = weather.Selections()
+
+ # otherwise be helpful
+ else:
+ sys.argv += ("--help",)
+ selections = weather.Selections()
+
+# these modes analyze correlations
+if selections.get_bool("info"):
+ weather.guess(
+ selections.arguments[0],
+ path=selections.get("setpath"),
+ info=selections.get_bool("info"),
+ cache_search=(
+ selections.get_bool("cache") \
+ and selections.get_bool("cache_search")
+ ),
+ cacheage=selections.getint("cacheage"),
+ cachedir=selections.get("cachedir")
+ )