Skip to content

Commit

Permalink
added foot
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Mar 9, 2023
1 parent 165eefd commit c62fd61
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 0 deletions.
59 changes: 59 additions & 0 deletions completers/foot_completer/cmd/root.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/pkg/actions/os"
"github.com/rsteube/carapace-bin/pkg/util/embed"
"github.com/rsteube/carapace/pkg/style"
"github.com/spf13/cobra"
)

var rootCmd = &cobra.Command{
Use: "foot",
Short: "A fast, lightweight and minimalistic Wayland terminal emulator",
Long: "https://codeberg.org/dnkl/foot",
Run: func(cmd *cobra.Command, args []string) {},
}

func Execute() error {
return rootCmd.Execute()
}
func init() {
carapace.Gen(rootCmd).Standalone()

rootCmd.Flags().StringP("app-id", "a", "", "window application ID (foot)")
rootCmd.Flags().BoolP("check-config", "C", false, "verify configuration, exit with 0 if ok, otherwise exit with 1")
rootCmd.Flags().StringP("config", "c", "", "load configuration from PATH ($XDG_CONFIG_HOME/foot/foot.ini)")
rootCmd.Flags().BoolS("e", "e", false, "ignored (for compatibility with xterm -e)")
rootCmd.Flags().StringP("font", "f", "", "comma separated list of fonts in fontconfig format (monospace)")
rootCmd.Flags().BoolP("fullscreen", "F", false, "start in fullscreen mode")
rootCmd.Flags().BoolP("hold", "H", false, "remain open after child process exits")
rootCmd.Flags().StringP("log-colorize", "l", "", "enable/disable colorization of log output on stderr")
rootCmd.Flags().StringP("log-level", "d", "", "log level (info)")
rootCmd.Flags().Bool("log-no-syslog", false, "disable syslog logging (only applicable in server mode)")
rootCmd.Flags().BoolP("login-shell", "L", false, "start shell as a login shell")
rootCmd.Flags().BoolP("maximized", "m", false, "start in maximized mode")
rootCmd.Flags().StringP("override", "o", "", "override configuration option")
rootCmd.Flags().StringP("print-pid", "p", "", "print PID to file or FD (only applicable in server mode)")
rootCmd.Flags().StringP("server", "s", "", "run as a server (use 'footclient' to start terminals).")
rootCmd.Flags().StringP("term", "t", "", "value to set the environment variable TERM to (foot)")
rootCmd.Flags().StringP("title", "T", "", "initial window title (foot)")
rootCmd.Flags().BoolP("version", "v", false, "show the version number and quit")
rootCmd.Flags().StringP("window-size-chars", "W", "", "initial width and height, in characters")
rootCmd.Flags().StringP("window-size-pixels", "w", "", "initial width and height, in pixels")
rootCmd.Flags().StringP("working-directory", "D", "", "directory to start in (CWD)")

rootCmd.Flag("server").NoOptDefVal = " "
rootCmd.Flag("log-colorize").NoOptDefVal = " "

carapace.Gen(rootCmd).FlagCompletion(carapace.ActionMap{
"config": carapace.ActionFiles(),
"font": os.ActionFontFamilies(),
"log-colorize": carapace.ActionValues("never", "always", "auto").StyleF(style.ForKeyword),
"log-level": carapace.ActionValues("info", "warning", "error", "none").StyleF(style.ForLogLevel),
"server": carapace.ActionFiles(),
"working-directory": carapace.ActionDirectories(),
})

embed.EmbedCarapaceBin(rootCmd)
}
7 changes: 7 additions & 0 deletions completers/foot_completer/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

import "github.com/rsteube/carapace-bin/completers/foot_completer/cmd"

func main() {
cmd.Execute()
}

0 comments on commit c62fd61

Please sign in to comment.