-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4945a26
commit bc398ae
Showing
4 changed files
with
15 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,16 @@ package cli | |
|
||
import "github.com/spf13/cobra" | ||
|
||
var isDocsBuild = false | ||
const DispatchCmdLong = `Welcome to Dispatch! | ||
To get started, use the login command to authenticate with Dispatch or create an account. | ||
Documentation: https://docs.dispatch.run | ||
Discord: https://dispatch.run/discord | ||
Support: [email protected] | ||
` | ||
|
||
const RunExampleText = " dispatch run [options] -- <command>" | ||
|
||
func generateDocs(_ *cobra.Command, _ string) { | ||
// do nothing if the build tag "docs" is not set | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,29 +6,11 @@ import ( | |
"github.com/spf13/cobra" | ||
) | ||
|
||
var ( | ||
DispatchCmdLong = `Welcome to Dispatch! | ||
To get started, use the login command to authenticate with Dispatch or create an account. | ||
Documentation: https://docs.dispatch.run | ||
Discord: https://dispatch.run/discord | ||
Support: [email protected] | ||
` | ||
) | ||
|
||
var mainCommandText string | ||
|
||
func createMainCommand() *cobra.Command { | ||
if isDocsBuild { | ||
mainCommandText = "This is the main command for Dispatch CLI. Add a subcommand to make it useful." | ||
} else { | ||
mainCommandText = DispatchCmdLong | ||
} | ||
cmd := &cobra.Command{ | ||
Version: version(), | ||
Use: "dispatch", | ||
Long: mainCommandText, | ||
Long: DispatchCmdLong, | ||
Short: "Main command for Dispatch CLI", | ||
PersistentPreRunE: func(cmd *cobra.Command, args []string) error { | ||
return loadEnvFromFile(DotEnvFilePath) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters