diff options
author | spf13 <[email protected]> | 2013-09-29 02:09:03 -0400 |
---|---|---|
committer | spf13 <[email protected]> | 2013-09-29 02:10:29 -0400 |
commit | 94d7fe52f87a3188a27767433e7a07f5ada84988 (patch) | |
tree | abdde05fb89da61e383f4e34924729df0e80e159 /commands/check.go | |
parent | 92cff055828ff250a5d40c3dae55f0d0235c7f61 (diff) | |
download | hugo-94d7fe52f87a3188a27767433e7a07f5ada84988.tar.gz hugo-94d7fe52f87a3188a27767433e7a07f5ada84988.zip |
Change the interface to use commands and flags instead of just flags.
Better organization of main (controller style) code.
Diffstat (limited to 'commands/check.go')
-rw-r--r-- | commands/check.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/commands/check.go b/commands/check.go new file mode 100644 index 000000000..6ce8b8177 --- /dev/null +++ b/commands/check.go @@ -0,0 +1,31 @@ +// Copyright © 2013 Steve Francia <[email protected]>. +// +// Licensed under the Simple Public License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://opensource.org/licenses/Simple-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package commands + +import ( + "github.com/spf13/cobra" + "github.com/spf13/hugo/hugolib" +) + +var check = &cobra.Command{ + Use: "check", + Short: "Check content in the source directory", + Long: `Hugo will perform some basic analysis on the + content provided and will give feedback.`, + Run: func(cmd *cobra.Command, args []string) { + InitializeConfig() + site := hugolib.Site{Config: *Config} + site.Analyze() + }, +} |