Skip to content

Commit

Permalink
Add root command and execution function
Browse files Browse the repository at this point in the history
Two new files, root.go and main.go, were created as part of the "task-tower" command. The root.go file defines and initializes the root command, while main.go executes the root command. Additionally, the "Installation" section in the README.md file has been updated.
  • Loading branch information
PiotrFerenc committed May 7, 2024
1 parent 93dd964 commit 67f4570
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 4 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ Task Tower is a tool for automating distributed tasks, utilizing pipelines with
- Ease of integration and collaboration

## How it works
## Installation

## Installation
## Build

### requirements

Expand All @@ -53,12 +54,9 @@ make docker-rebuild

## Usage



## Actions



## Todo 1.0
- [x] Application Programming Interface (API)
- [ ] Monitoring and Logging
Expand Down
Empty file added cmd/task-tower/LICENSE
Empty file.
46 changes: 46 additions & 0 deletions cmd/task-tower/cmd/root.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
*/
package cmd

import (
"os"

"github.com/spf13/cobra"
)

// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "cmd",
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:
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) { },
}

// Execute adds all child commands to the root command and sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
err := rootCmd.Execute()
if err != nil {
os.Exit(1)
}
}

func init() {
// Here you will define your flags and configuration settings.
// Cobra supports persistent flags, which, if defined here,
// will be global for your application.

// rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.cmd.yaml)")

// Cobra also supports local flags, which will only run
// when this action is called directly.
rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}
10 changes: 10 additions & 0 deletions cmd/task-tower/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
Copyright © 2024 NAME HERE <EMAIL ADDRESS>
*/
package main

import "github.com/PiotrFerenc/mash2/cmd/task-tower/cmd"

func main() {
cmd.Execute()
}

0 comments on commit 67f4570

Please sign in to comment.