Skip to content

Commit

Permalink
feat: Add a boilerplate cmd for HTML generation
Browse files Browse the repository at this point in the history
  • Loading branch information
zntheory committed Jul 9, 2024
1 parent ef7b3ae commit 9a63237
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/cmd/generate.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package cmd

import (
"github.com/Slug-Boi/aion-cli/html"
"github.com/spf13/cobra"
)

// generateCmd represents the generate command
var generateCmd = &cobra.Command{
Use: "generate <FilePath>",
Short: "Generates an HTML file that is populated with CSV data",
Long: `This command reads from a given CSV file, and then generates an HTML file populated with the CSV data.
The FilePath refers to the designated path. An example would be: 'C://Program/MyCSVFile.csv'`,
Args: cobra.MinimumNArgs(1),
Run: func(cmd *cobra.Command, args []string) {
// TODO: Retrieve args after Strawpoll feat
//specs := Reader.CsvToString(args[0])
html.GenerateHTML()
},
}

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

0 comments on commit 9a63237

Please sign in to comment.