From ee1ef2dd733607f74125c28e8385e562f90ca38c Mon Sep 17 00:00:00 2001 From: VERSE Date: Fri, 3 Jul 2026 13:55:07 +0700 Subject: [PATCH] feat(init): allow passing specific shell to setup command (#25) --- root/init.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/root/init.go b/root/init.go index c79c5b1..23ef7dd 100644 --- a/root/init.go +++ b/root/init.go @@ -97,8 +97,9 @@ func init() { } var setupCmd = &cobra.Command{ - Use: "setup", + Use: "setup [shell]", Short: "Automatically setup iris shell integration and install binary", + Args: cobra.MaximumNArgs(1), Run: func(cmd *cobra.Command, args []string) { home, _ := os.UserHomeDir() @@ -122,8 +123,13 @@ var setupCmd = &cobra.Command{ return } - shellPath := os.Getenv("SHELL") - shellName := filepath.Base(shellPath) + var shellName string + if len(args) > 0 { + shellName = args[0] + } else { + shellPath := os.Getenv("SHELL") + shellName = filepath.Base(shellPath) + } var configFile string var evalCmd string