File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,8 +15,22 @@ func main() {
1515 // This also setup the config global !
1616 configErr := config_file .ReadConfigFile (config .Config .ProjectConfigFile ())
1717
18- // whenever there is no configuration file, the only command allowed to run is the 'init'
19- if configErr != nil && len (os .Args ) > 1 && os .Args [1 ] != "init" {
18+ // Show help if any argument contains help
19+ for _ , arg := range os .Args {
20+ if arg == "--help" || arg == "-h" || arg == "help" {
21+ cmd .Execute ()
22+ return
23+ }
24+ }
25+
26+ // Check if command is init
27+ if len (os .Args ) > 1 && os .Args [1 ] == "init" {
28+ cmd .Execute ()
29+ return
30+ }
31+
32+ // All other commands require a configuration file
33+ if configErr != nil && len (os .Args ) > 1 {
2034 fmt .Println ("No configuration file was found, execute init command first." )
2135 return
2236 }
You can’t perform that action at this time.
0 commit comments