degal/main.py
changeset 124 cac613118e75
parent 120 55cb7fc9c8fb
child 144 97505a789003
equal deleted inserted replaced
123:31c4a328ef96 124:cac613118e75
     1 """
     1 """
     2     Main entry point for the command-line interface
     2     Main entry point for the command-line interface
     3 """
     3 """
     4 
     4 
     5 import gallery, commands, config
     5 import gallery, commands, config, version
     6 
     6 
     7 from optparse import OptionParser
     7 from optparse import OptionParser
     8 import os.path
     8 import os.path
     9 
     9 
    10 def build_config () :
    10 def build_config () :
    17 def option_parser (exec_name) :
    17 def option_parser (exec_name) :
    18     """
    18     """
    19         Build the OptionParser that we use
    19         Build the OptionParser that we use
    20     """
    20     """
    21     
    21     
    22     parser = OptionParser(prog=exec_name, description="Degal - A photo gallery", version="???")
    22     parser = OptionParser(prog=exec_name, description="Degal - A photo gallery", version="Degal %s" % version.VERSION_STRING)
    23     
    23     
    24     parser.add_option('-C', "--config",         metavar='PATH', dest="_load_config_path",
    24     parser.add_option('-C', "--config",         metavar='PATH', dest="_load_config_path",
    25             help="Load configuration from PATH")
    25             help="Load configuration from PATH")
    26 
    26 
    27     parser.add_option('-H', "--gallery-path",   metavar='DIR',
    27     parser.add_option('-H', "--gallery-path",   metavar='DIR',