update usage, header + footer.

This commit is contained in:
onyx-and-iris 2025-06-18 06:26:34 +01:00
parent 11fe797f3f
commit f51302a945
3 changed files with 7 additions and 7 deletions

4
.gitignore vendored
View File

@ -1,4 +1,4 @@
# Generated by ignr-cli: github.com/onyx-and-iris/ignr-cli # Generated by ignr: github.com/onyx-and-iris/ignr
## Go ## ## Go ##
# If you prefer the allow list template instead of the deny list, see community template: # If you prefer the allow list template instead of the deny list, see community template:
@ -36,4 +36,4 @@ go.work.sum
# .idea/ # .idea/
# .vscode/ # .vscode/
# End of ignr-cli # End of ignr

View File

@ -18,9 +18,9 @@ var version string // Version of the CLI, set during build time
// rootCmd represents the base command when called without any subcommands. // rootCmd represents the base command when called without any subcommands.
var rootCmd = &cobra.Command{ var rootCmd = &cobra.Command{
Use: "ignr-cli", Use: "ignr",
Short: "A command-line interface for generating .gitignore files", Short: "A command-line interface for generating .gitignore files",
Long: `ignr-cli is a command-line interface for generating .gitignore files. Long: `ignr is a command-line interface for generating .gitignore files.
It allows users to easily create and manage .gitignore files for various programming languages and frameworks. It allows users to easily create and manage .gitignore files for various programming languages and frameworks.
You may also list available templates and generate .gitignore files based on those templates.`, You may also list available templates and generate .gitignore files based on those templates.`,
SilenceUsage: true, SilenceUsage: true,
@ -43,7 +43,7 @@ You may also list available templates and generate .gitignore files based on tho
} }
version = strings.Split(info.Main.Version, "-")[0] version = strings.Split(info.Main.Version, "-")[0]
} }
fmt.Printf("ignr-cli version: %s\n", version) fmt.Printf("ignr version: %s\n", version)
return nil return nil
} }

4
new.go
View File

@ -97,7 +97,7 @@ func runPrompt(client *github.Client, height int) (*github.Gitignore, error) {
// commitGitignore writes the content of the selected gitignore template to the .gitignore file. // commitGitignore writes the content of the selected gitignore template to the .gitignore file.
func commitGitignore(content *github.Gitignore, w io.Writer) error { func commitGitignore(content *github.Gitignore, w io.Writer) error {
if _, err := fmt.Fprintf(w, "# Generated by ignr-cli: github.com/onyx-and-iris/ignr-cli\n\n## %s ##\n", content.GetName()); err != nil { if _, err := fmt.Fprintf(w, "# Generated by ignr: github.com/onyx-and-iris/ignr\n\n## %s ##\n", content.GetName()); err != nil {
return fmt.Errorf("error writing header to file '%s': %w", gitignoreFileName, err) return fmt.Errorf("error writing header to file '%s': %w", gitignoreFileName, err)
} }
@ -105,7 +105,7 @@ func commitGitignore(content *github.Gitignore, w io.Writer) error {
return fmt.Errorf("error writing to file '%s': %w", gitignoreFileName, err) return fmt.Errorf("error writing to file '%s': %w", gitignoreFileName, err)
} }
if _, err := fmt.Fprintf(w, "\n# End of ignr-cli\n"); err != nil { if _, err := fmt.Fprintf(w, "\n# End of ignr\n"); err != nil {
return fmt.Errorf("error writing footer to file '%s': %w", gitignoreFileName, err) return fmt.Errorf("error writing footer to file '%s': %w", gitignoreFileName, err)
} }