7 "charm.land/lipgloss/v2"
8 "charm.land/lipgloss/v2/table"
9 "github.com/charmbracelet/crush/internal/config"
10 "github.com/charmbracelet/x/term"
11 "github.com/spf13/cobra"
14var dirsCmd = &cobra.Command{
16 Short: "Print directories used by Crush",
17 Long: `Print the directories where Crush stores its configuration and data files.
18This includes the global configuration directory and data directory.`,
20# Print all directories
23# Print only the config directory
26# Print only the data directory
29 Run: func(cmd *cobra.Command, args []string) {
30 if term.IsTerminal(os.Stdout.Fd()) {
31 // We're in a TTY: make it fancy.
33 Border(lipgloss.RoundedBorder()).
34 StyleFunc(func(row, col int) lipgloss.Style {
35 return lipgloss.NewStyle().Padding(0, 2)
37 Row("Config", filepath.Dir(config.GlobalConfig())).
38 Row("Data", filepath.Dir(config.GlobalConfigData()))
43 cmd.Println(filepath.Dir(config.GlobalConfig()))
44 cmd.Println(filepath.Dir(config.GlobalConfigData()))
48var configDirCmd = &cobra.Command{
50 Short: "Print the configuration directory used by Crush",
51 Run: func(cmd *cobra.Command, args []string) {
52 cmd.Println(filepath.Dir(config.GlobalConfig()))
56var dataDirCmd = &cobra.Command{
58 Short: "Print the datauration directory used by Crush",
59 Run: func(cmd *cobra.Command, args []string) {
60 cmd.Println(filepath.Dir(config.GlobalConfigData()))
65 dirsCmd.AddCommand(configDirCmd, dataDirCmd)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list