Adding proper command line option parsing

This commit is contained in:
spf13 2013-07-19 00:38:24 -07:00
parent af5e4d1a56
commit 1cf78a9abe

View File

@ -7,15 +7,17 @@ Make sure either hugo is in your path or provide a path to it.
$ hugo --help $ hugo --help
usage: hugo [flags] [] usage: hugo [flags] []
-b="": hostname (and path) to the root eg. http://spf13.com/ -b, --base-url="": hostname (and path) to the root eg. http://spf13.com/
-c="config.json": config file (default is path/config.json) -d, --build-drafts=false: include content marked as draft
-d=false: include content marked as draft --config="": config file (default is path/config.yaml|json|toml)
-h=false: show this help -h, --help=false: show this help
-k=false: analyze content and provide feedback --port="1313": port to run web server on, default :1313
-p="": filesystem path to read files relative from -S, --server=false: run a (very) simple web server
-w=false: watch filesystem for changes and recreate as needed -s, --source="": filesystem path to read files relative from
-s=false: a (very) simple webserver --uglyurls=false: use /filename.html instead of /filename/
-port="1313": port for webserver to run on -v, --verbose=false: verbose output
--version=false: which version of hugo
-w, --watch=false: watch filesystem for changes and recreate as needed
## Common Usage Example: ## Common Usage Example:
@ -35,14 +37,14 @@ immediately, tell Hugo to watch for changes.
recreate the site faster than you can tab over to recreate the site faster than you can tab over to
your browser to view the changes.** your browser to view the changes.**
$ hugo -p ~/mysite -w $ hugo --source ~/mysite --watch
Watching for changes. Press ctrl+c to stop Watching for changes. Press ctrl+c to stop
15 pages created 15 pages created
0 tags created 0 tags created
Hugo can even run a server and create your site at the same time! Hugo can even run a server and create your site at the same time!
$hugo -p ~/mysite -w -s $hugo --server -ws ~/mysite
Watching for changes. Press ctrl+c to stop Watching for changes. Press ctrl+c to stop
15 pages created 15 pages created
0 tags created 0 tags created