Skip to content

Commit

Permalink
add version info
Browse files Browse the repository at this point in the history
  • Loading branch information
toadle committed Oct 23, 2022
1 parent ef1f705 commit 0983159
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 16 deletions.
19 changes: 7 additions & 12 deletions cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
*/
package cmd

import (
Expand All @@ -11,24 +7,23 @@ import (
"lit/internal/config"
"lit/internal/tui"

tea "github.com/charmbracelet/bubbletea"
homedir "github.com/mitchellh/go-homedir"
"github.com/spf13/cobra"
"github.com/spf13/viper"
tea "github.com/charmbracelet/bubbletea"
)

var cliCfg = config.LauncherConfig{}

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "launcher",
Short: "A brief description of your application",
Long: `A longer description that spans multiple lines and likely contains
examples and usage of using your application. For example:
Use: "lit",
Short: "A command-line quicklauncher.",
Long: `lit
An easily configurable quicklauncher for your terminal.
You need to create a ~/.lit.yml config file in order to use it.
See https://github.com/toadle/lit for help.`,

Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
// Uncomment the following line if your bare application
// has an action associated with it:
Run: func(cmd *cobra.Command, args []string) {
Expand Down
20 changes: 20 additions & 0 deletions cmd/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package cmd

import (
"fmt"

"github.com/spf13/cobra"
)

func init() {
rootCmd.AddCommand(versionCmd)
}

var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version number of lit",
Long: `All software has versions. This is lit's`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("lit - a commandline quicklauncher v0.1 -- HEAD")
},
}
4 changes: 0 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
/*
Copyright © 2022 NAME HERE <EMAIL ADDRESS>
*/
package main

import "lit/cmd"
Expand Down

0 comments on commit 0983159

Please sign in to comment.