Skip to content

Commit

Permalink
continue work on hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdul Dakkak committed Mar 18, 2017
1 parent 11b0ac9 commit 6198ff6
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/rai-project/client"
"github.com/rai-project/cmd"
"github.com/rai-project/config"
_ "github.com/rai-project/logger/hooks"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
Expand All @@ -30,7 +31,8 @@ var RootCmd = &cobra.Command{
SilenceUsage: true,
PersistentPreRunE: func(cmd *cobra.Command, args []string) error {
if workingDir == "" || !com.IsDir(workingDir) {
fmt.Printf("Error:: the directory specified = %s was not found.\n", workingDir)
fmt.Printf("Error:: the directory specified = %s was not found. "+
"Use the --path option to specify the directory you want to build.\n", workingDir)
return errors.New("Invalid directory")
}
return nil
Expand Down Expand Up @@ -96,7 +98,7 @@ func init() {
RootCmd.PersistentFlags().StringVarP(&workingDir, "path", "p", cwd,
"Path to the directory you wish to submit. Defaults to the current working directory.")
RootCmd.PersistentFlags().StringVarP(&appSecret, "secret", "s", "", "Pass in application secret.")
RootCmd.PersistentFlags().BoolVarP(&isColor, "color", "c", !color.NoColor, "Toggle color output.")
RootCmd.PersistentFlags().BoolVarP(&isColor, "color", "c", true, "Toggle color output.")
RootCmd.PersistentFlags().BoolVarP(&isVerbose, "verbose", "v", false, "Toggle verbose mode.")
RootCmd.PersistentFlags().BoolVarP(&isDebug, "debug", "d", false, "Toggle debug mode.")
RootCmd.PersistentFlags().BoolVar(&isRatelimit, "ratelimit", true, "Toggle debug mode.")
Expand All @@ -117,6 +119,7 @@ func init() {
func initConfig() {
opts := []config.Option{
config.AppName("rai"),
config.ColorMode(isColor),
config.ConfigString(configContent),
}
if appSecret != "" {
Expand Down

0 comments on commit 6198ff6

Please sign in to comment.