snappy 614 Bytes
Newer Older
1
#!/usr/bin/env python3.5
2 3

import sys
4
import os.path
5
import snappylib.place as place
6
import snappylib.commands as commands
7
import snappylib.configuration as configuration
8 9

if len(sys.argv) < 2:
10
    commands.usage.call()
11
else:
12
    sys.argv.pop(0)
13 14 15
    # Special case for the check command - it will want control over loading
    # the ini file itself
    if sys.argv[0] != "check":
16 17 18 19
        configfile = None
        if os.path.isfile(configuration.GLOBALFILE):
            configfile = configuration.GLOBALFILE
        configuration.loadINI(configfile)
20
    commands.byname.get(sys.argv.pop(0), commands.usage).call()