30
28
from loggerhead import __version__
31
29
from loggerhead.apps.filesystem import (
32
30
BranchesFromFileSystemRoot, UserBranchesFromFileSystemRoot)
31
from loggerhead.config import command_line_parser
33
32
from loggerhead.util import Reloader
34
33
from loggerhead.apps.error import ErrorHandlerApp
37
def command_line_parser():
38
parser = OptionParser("%prog [options] <path>")
44
parser.add_option("--user-dirs", action="store_true", dest="user_dirs",
45
help="Serve user directories as ~user.")
46
parser.add_option("--trunk-dir", metavar="DIR",
47
help="The directory that contains the trunk branches.")
48
parser.add_option("--port", dest="user_port",
49
help=("Port Loggerhead should listen on "
50
"(defaults to 8080)."))
51
parser.add_option("--host", dest="user_host",
52
help="Host Loggerhead should listen on.")
53
parser.add_option('--memory-profile', action='store_true',
54
dest='memory_profile',
55
help='Profile the memory usage using heapy.')
56
parser.add_option("--prefix", dest="user_prefix",
57
help="Specify host prefix.")
58
parser.add_option("--profile", action="store_true", dest="profile",
59
help="Generate callgrind profile data to "
60
"%d-stats.callgrind on each request.")
61
parser.add_option("--reload", action="store_true", dest="reload",
62
help="Restarts the application when changing python"
63
" files. Only used for development purposes.")
64
parser.add_option('--log-folder', dest="log_folder",
65
type=str, help="The directory to place log files in.")
66
parser.add_option("--version", action="store_true", dest="show_version",
67
help="Print the software version and exit")
72
37
parser = command_line_parser()
73
38
(options, args) = parser.parse_args(sys.argv[1:])