refactor: change text language to english
This commit is contained in:
parent
e17e071443
commit
6fcd9dbdc3
1 changed files with 14 additions and 14 deletions
28
main.go
28
main.go
|
|
@ -12,12 +12,12 @@ import (
|
||||||
func main() {
|
func main() {
|
||||||
var rootCmd = &cobra.Command{
|
var rootCmd = &cobra.Command{
|
||||||
Use: "tmux_popup",
|
Use: "tmux_popup",
|
||||||
Short: "Ein CLI-Tool für verschiedene Aktionen",
|
Short: "A CLI tool for various actions",
|
||||||
Long: "tmux_popup ist ein CLI-Werkzeug, das verschiedene Aktionen wie tmux, lazygit, harlequin und postings unterstützt. Es oeffnet diese Programme in einem floating tmux pane",
|
Long: "tmux_popup is a CLI tool that supports various actions like tmux, lazygit, harlequin, and postings. It opens these programs in a floating tmux pane.",
|
||||||
}
|
}
|
||||||
|
|
||||||
rootCmd.PersistentFlags().String("width", "80%", "Breite des Popups (z. B. 80%)")
|
rootCmd.PersistentFlags().String("width", "80%", "Width of the popup (e.g., 80%)")
|
||||||
rootCmd.PersistentFlags().String("height", "80%", "Höhe des Popups (z. B. 80%)")
|
rootCmd.PersistentFlags().String("height", "80%", "Height of the popup (e.g., 80%)")
|
||||||
|
|
||||||
rootCmd.AddCommand(tmuxCmd)
|
rootCmd.AddCommand(tmuxCmd)
|
||||||
rootCmd.AddCommand(lazygitCmd)
|
rootCmd.AddCommand(lazygitCmd)
|
||||||
|
|
@ -26,14 +26,14 @@ func main() {
|
||||||
rootCmd.AddCommand(checkCmd)
|
rootCmd.AddCommand(checkCmd)
|
||||||
|
|
||||||
if err := rootCmd.Execute(); err != nil {
|
if err := rootCmd.Execute(); err != nil {
|
||||||
fmt.Println("Fehler:", err)
|
fmt.Println("Error:", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var tmuxCmd = &cobra.Command{
|
var tmuxCmd = &cobra.Command{
|
||||||
Use: "tmux",
|
Use: "tmux",
|
||||||
Short: "Öffnet ein tmux-Popup",
|
Short: "Opens a tmux popup",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
width, _ := cmd.Flags().GetString("width")
|
width, _ := cmd.Flags().GetString("width")
|
||||||
height, _ := cmd.Flags().GetString("height")
|
height, _ := cmd.Flags().GetString("height")
|
||||||
|
|
@ -43,7 +43,7 @@ var tmuxCmd = &cobra.Command{
|
||||||
|
|
||||||
var lazygitCmd = &cobra.Command{
|
var lazygitCmd = &cobra.Command{
|
||||||
Use: "lazygit",
|
Use: "lazygit",
|
||||||
Short: "Öffnet lazygit in einem Popup",
|
Short: "Opens lazygit in a popup",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
width, _ := cmd.Flags().GetString("width")
|
width, _ := cmd.Flags().GetString("width")
|
||||||
height, _ := cmd.Flags().GetString("height")
|
height, _ := cmd.Flags().GetString("height")
|
||||||
|
|
@ -53,7 +53,7 @@ var lazygitCmd = &cobra.Command{
|
||||||
|
|
||||||
var harlequinCmd = &cobra.Command{
|
var harlequinCmd = &cobra.Command{
|
||||||
Use: "harlequin",
|
Use: "harlequin",
|
||||||
Short: "Öffnet harlequin in einem Popup",
|
Short: "Opens harlequin in a popup",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
width, _ := cmd.Flags().GetString("width")
|
width, _ := cmd.Flags().GetString("width")
|
||||||
height, _ := cmd.Flags().GetString("height")
|
height, _ := cmd.Flags().GetString("height")
|
||||||
|
|
@ -63,7 +63,7 @@ var harlequinCmd = &cobra.Command{
|
||||||
|
|
||||||
var postingsCmd = &cobra.Command{
|
var postingsCmd = &cobra.Command{
|
||||||
Use: "postings",
|
Use: "postings",
|
||||||
Short: "Öffnet postings in einem Popup",
|
Short: "Opens postings in a popup",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
width, _ := cmd.Flags().GetString("width")
|
width, _ := cmd.Flags().GetString("width")
|
||||||
height, _ := cmd.Flags().GetString("height")
|
height, _ := cmd.Flags().GetString("height")
|
||||||
|
|
@ -73,20 +73,20 @@ var postingsCmd = &cobra.Command{
|
||||||
|
|
||||||
var checkCmd = &cobra.Command{
|
var checkCmd = &cobra.Command{
|
||||||
Use: "check",
|
Use: "check",
|
||||||
Short: "Prüft die Abhängigkeiten",
|
Short: "Checks the dependencies",
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
if err := CheckDependencies(); err != nil {
|
if err := CheckDependencies(); err != nil {
|
||||||
fmt.Println("Fehler bei der Überprüfung der Abhängigkeiten:", err)
|
fmt.Println("Error checking dependencies:", err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
fmt.Println("Alle Abhängigkeiten sind vorhanden.")
|
fmt.Println("All dependencies are present.")
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
func openPopup(sessionName, command string, width, height string) {
|
func openPopup(sessionName, command string, width, height string) {
|
||||||
currentSession, err := exec.Command("tmux", "display-message", "-p", "-F", "#{session_name}").Output()
|
currentSession, err := exec.Command("tmux", "display-message", "-p", "-F", "#{session_name}").Output()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("Fehler beim Abrufen der aktuellen Session:", err)
|
fmt.Println("Error retrieving the current session:", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -124,7 +124,7 @@ func CheckDependencies() error {
|
||||||
func runCmd(dep string, args []string) error {
|
func runCmd(dep string, args []string) error {
|
||||||
cmd := exec.Command(dep, args...)
|
cmd := exec.Command(dep, args...)
|
||||||
if err := cmd.Run(); err != nil {
|
if err := cmd.Run(); err != nil {
|
||||||
return fmt.Errorf("Fehler beim Überprüfen von %s: %w", dep, err)
|
return fmt.Errorf("Error checking %s: %w", dep, err)
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue