Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Command = &cobra.Command{ Use: CommandString, Short: "source a script or snippet", Long: `if it runs with clog cmd then it will source with eval "$(clog Source cmd)"`, Run: func(cmd *cobra.Command, args []string) { cmdString := strings.Join(args, " ") slog.Debug("searching snippets: " + cmdString) srcCmd, err := FindSnippet(cmd.Root(), args) if err == nil { switch srcCmd.Annotations["is-a"] { case "snippet": fmt.Println(srcCmd.Annotations["script"]) os.Exit(0) case "script": fmt.Println(srcCmd.Annotations["file-path"]) os.Exit(0) default: slog.Error(fmt.Sprintf("clog Source (%s) neither snippet nor script", cmdString)) os.Exit(1) } } slog.Error(fmt.Sprintf("clog Source (%s) %s", cmdString, err.Error())) os.Exit(1) }, }
Command define the cobra settings for this command
View Source
var CommandString = "Source"
View Source
var JustCrayon bool = false
View Source
var SnippetsTree bool = false
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.