1 | #!/usr/bin/env coffee
|
2 | #+--------------------------------------------------------------------+
|
3 | #| Huginn
|
4 | #+--------------------------------------------------------------------+
|
5 | #| Copyright DarkOverlordOfData (c) 2013
|
6 | #+--------------------------------------------------------------------+
|
7 | #|
|
8 | #| This file is a part of Huginn
|
9 | #|
|
10 | #| Hugin is free software; you can copy, modify, and distribute
|
11 | #| it under the terms of the MIT License
|
12 | #|
|
13 | #+--------------------------------------------------------------------+
|
14 | #
|
15 | hugin = require("../lib/huginn")
|
16 |
|
17 | $usage = """
|
18 | Usage:
|
19 | huginn create PATH [-b <name>]
|
20 |
|
21 | cd PATH
|
22 | huginn build [--drafts] [--dev]
|
23 | huginn serve [--dev]
|
24 |
|
25 | Options:
|
26 | -b [--branch] # branch name subfolder, defaults to master
|
27 | -d [--drafts] # publish _drafts folder
|
28 | -h [--help] # display this message
|
29 | -p [--port] # port to use
|
30 | -v [--version] # display version
|
31 |
|
32 | --dev # use config-dev.yml
|
33 |
|
34 | """
|
35 | switch process.argv[2]
|
36 |
|
37 | when 'create' then hugin.create process.argv.slice(3)...
|
38 |
|
39 | when 'build' then hugin.build process.argv.slice(3)
|
40 |
|
41 | when 'serve' then hugin.serve process.argv.slice(3)
|
42 |
|
43 | when '--version' then console.log "huginn v"+require('../package.json').version
|
44 |
|
45 | when '-v' then console.log "huginn v"+require('../package.json').version
|
46 |
|
47 | when '--help' then console.log $usage
|
48 |
|
49 | when '-h' then console.log $usage
|
50 |
|
51 | else console.log $usage
|