-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improvement: add cmd text to i18n package & stdout handling & error h…
…andling
- Loading branch information
1 parent
030bdf3
commit ee5b78e
Showing
20 changed files
with
301 additions
and
200 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 |
---|---|---|
@@ -1,13 +1,9 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
|
||
"github.com/zeropsio/zcli/src/cmd" | ||
) | ||
|
||
func main() { | ||
if cmd.ExecuteCmd() != nil { | ||
os.Exit(1) | ||
} | ||
cmd.ExecuteCmd() | ||
} |
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
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
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 |
---|---|---|
|
@@ -2,32 +2,26 @@ package cmd | |
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/zeropsio/zcli/src/cmdBuilder" | ||
"github.com/zeropsio/zcli/src/i18n" | ||
"github.com/zeropsio/zcli/src/printer" | ||
"github.com/zeropsio/zcli/src/uxBlock/styles" | ||
) | ||
|
||
var support string | ||
|
||
func supportCmd() *cmdBuilder.Cmd { | ||
return cmdBuilder.NewCmd(). | ||
Use("support"). | ||
Short(i18n.T(i18n.CmdDescSupport)). | ||
HelpFlag(i18n.T(i18n.CmdHelpSupport)). | ||
GuestRunFunc(func(ctx context.Context, cmdData *cmdBuilder.GuestCmdData) error { | ||
|
||
|
||
fmt.Println("You can contact Zerops support via:") | ||
fmt.Println("- E-mail: [email protected]") | ||
fmt.Println("- Discord: https://discord.com/invite/WDvCZ54") | ||
fmt.Println(` | ||
Additionally, you can explore our documentation | ||
at https://docs.zerops.io/references/cli for further details. | ||
`) | ||
return nil | ||
|
||
cmdData.Stdout.PrintLines( | ||
printer.Style(styles.CobraSectionColor(), i18n.T(i18n.Contact)), | ||
printer.Style(styles.CobraItemNameColor(), "- E-mail")+": [email protected]", | ||
printer.Style(styles.CobraItemNameColor(), "- Discord")+": https://discord.com/invite/WDvCZ54", | ||
printer.EmptyLine, | ||
i18n.T(i18n.Documentation), | ||
) | ||
return nil | ||
}) | ||
} | ||
|
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
Oops, something went wrong.