Skip to content

Commit 86cc61e

Browse files
committed
0
.3.8
1 parent b2b3617 commit 86cc61e

9 files changed

Lines changed: 128 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ jobs:
5151
5252
go build \
5353
-o "${PACKAGE_DIR}/${BINARY_NAME}${EXT}" \
54-
-ldflags="-s -w -X finderversion.Version=${VERSION}" \
54+
-ldflags="-s -w -X finderversion.Version=${VERSION} \
55+
-X finderversion.BuildTime=$(date -u '+%Y-%m-%dT%H:%M:%SZ')" \
5556
./cmd/finder
5657
5758
# add Changelog and Info about the program

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ build:
1010

1111
# Build a Release
1212
release:
13-
go build -ldflags="-s -w -X" ./cmd/finder
13+
go build -ldflags="-s -w -X finderversion.BuildTime=$(date -u '+%Y-%m-%dT%H:%M:%SZ')" ./cmd/finder
1414

1515
# Install the program
1616
install:

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ git push origin v0.3.7
88
Maybe
99
![GitHub Issues or Pull Requests](https://img.shields.io/github/issues/shadowdara/finder?logo=github)
1010
![GitHub Issues or Pull Requests](https://img.shields.io/github/issues-pr/shadowdara/finder?logo=github)
11+
[![GitHub top language](https://img.shields.io/github/languages/top/shadowdara/finder?logo=go&label=)](https://github.com/shadowdara/finder/)
1112
1213
-->
1314

@@ -185,4 +186,8 @@ TODO
185186
186187
- Fix Issue and PR Templates
187188
189+
IDEAS for Later
190+
191+
- should not search in the Trashbin
192+
188193
-->

ansicolors.hpp

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Header File with all ANSI Colors as Macros
2+
3+
#pragma once
4+
5+
#define END "\x1b[0m"
6+
#define BOLD "\x1b[1m"
7+
#define ITALIC "\x1b[3m"
8+
#define UNDERLINED "\x1b[4m"
9+
10+
#define REVERSE_TEXT "\x1b[7m"
11+
12+
#define NOT_UNDERLINED "\x1b[24m"
13+
14+
#define POSITIVE_TEXT "\x1b[27m"
15+
16+
#define BLACK "\x1b[30m"
17+
#define RED "\x1b[31m"
18+
#define GREEN "\x1b[32m"
19+
#define YELLOW "\x1b[33m"
20+
#define BLUE "\x1b[34m"
21+
#define PURPLE "\x1b[35m"
22+
#define CYAN "\x1b[36m"
23+
#define WHITE "\x1b[37m"
24+
25+
#define BG_BLACK "\x1b[40m"
26+
#define BG_RED "\x1b[41m"
27+
#define BG_GREEN "\x1b[42m"
28+
#define BG_YELLOW "\x1b[43m"
29+
#define BG_BLUE "\x1b[44m"
30+
#define BG_PURPLE "\x1b[45m"
31+
#define BG_CYAN "\x1b[46m"
32+
#define BG_WHITE "\x1b[47m"
33+
34+
#define BRIGHT_BLACK "\x1b[90m"
35+
#define BRIGHT_RED "\x1b[91m"
36+
#define BRIGHT_GREEM "\x1b[92m"
37+
#define BRIGHT_YELLOW "\x1b[93m"
38+
#define BRIGHT_BLUE "\x1b[94m"
39+
#define BRIGHT_PURLPE "\x1b[95m"
40+
#define BRIGHT_CYAN "\x1b[96m"
41+
#define BRIGHT_WHITE "\x1b[97m"
42+
43+
#define BG_BRIGHT_BLACK "\x1b[100m"
44+
#define BG_BRIGHT_RED "\x1b[101m"
45+
#define BG_BRIGHT_GREEM "\x1b[102m"
46+
#define BG_BRIGHT_YELLOW "\x1b[103m"
47+
#define BG_BRIGHT_BLUE "\x1b[104m"
48+
#define BG_BRIGHT_PURLPE "\x1b[105m"
49+
#define BG_BRIGHT_CYAN "\x1b[106m"
50+
#define BG_BRIGHT_WHITE "\x1b[107m"

ansicolors.py

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Python with ANSIColors
2+
#
3+
4+
END = "\x1b[0m"
5+
BOLD = "\x1b[1m"
6+
7+
ITALIC = "\x1b[3m"
8+
UNDERLINED = "\x1b[4m"
9+
10+
REVERSE_TEXT = "\x1b[7m"
11+
12+
NOT_UNDERLINED = "\x1b[24m"
13+
14+
POSITIVE_TEXT = "\x1b[27m"
15+
16+
BLACK = "\x1b[30m"
17+
RED = "\x1b[31m"
18+
GREEN = "\x1b[32m"
19+
YELLOW = "\x1b[33m"
20+
BLUE = "\x1b[34m"
21+
PURPLE = "\x1b[35m"
22+
CYAN = "\x1b[36m"
23+
WHITE = "\x1b[37m"
24+
25+
BG_BLACK = "\x1b[40m"
26+
BG_RED = "\x1b[41m"
27+
BG_GREEN = "\x1b[42m"
28+
BG_YELLOW = "\x1b[43m"
29+
BG_BLUE = "\x1b[44m"
30+
BG_PURPLE = "\x1b[45m"
31+
BG_CYAN = "\x1b[46m"
32+
BG_WHITE = "\x1b[47m"
33+
34+
BRIGHT_BLACK = "\x1b[90m"
35+
BRIGHT_RED = "\x1b[91m"
36+
BRIGHT_GREEM = "\x1b[92m"
37+
BRIGHT_YELLOW = "\x1b[93m"
38+
BRIGHT_BLUE = "\x1b[94m"
39+
BRIGHT_PURLPE = "\x1b[95m"
40+
BRIGHT_CYAN = "\x1b[96m"
41+
BRIGHT_WHITE = "\x1b[97m"
42+
43+
BG_BRIGHT_BLACK = "\x1b[100m"
44+
BG_BRIGHT_RED = "\x1b[101m"
45+
BG_BRIGHT_GREEM = "\x1b[102m"
46+
BG_BRIGHT_YELLOW = "\x1b[103m"
47+
BG_BRIGHT_BLUE = "\x1b[104m"
48+
BG_BRIGHT_PURLPE = "\x1b[105m"
49+
BG_BRIGHT_CYAN = "\x1b[106m"
50+
BG_BRIGHT_WHITE = "\x1b[107m"

internal/cli/commands.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ func HandleCommand(args []string) {
2828
versionCmd := argparser.NewCommand(
2929
"--version", "to get the Version of the Program", false, "-v", "v", "version")
3030

31+
// Temaplte Command
32+
templateCmd := argparser.NewCommand("template",
33+
"to search for a template - for the case that the name for a template is overwritten by another argument name",
34+
false, "tpl")
35+
3136
// Check Command
3237
checkCmd := argparser.NewCommand("check",
3338
"to check all available Templates if their syntax is correct", false)
@@ -49,6 +54,7 @@ func HandleCommand(args []string) {
4954
"shows help", true, "--help", "h", "-h")
5055

5156
root.AddSubcommand(versionCmd)
57+
root.AddSubcommand(templateCmd)
5258
root.AddSubcommand(checkCmd)
5359
root.AddSubcommand(listCmd)
5460
root.AddSubcommand(tagsCmd)
@@ -84,6 +90,14 @@ func HandleCommand(args []string) {
8490

8591
// Search for tags
8692
TagSearch(cmd.Args[0], finderconfig.OutputType, true)
93+
case templateCmd:
94+
if len(cmd.Args) == 0 {
95+
root.PrintHelp()
96+
return
97+
}
98+
99+
// Search the Template
100+
Search(cmd.Args[0], finderconfig.OutputType, true)
87101
default:
88102
if len(cmd.Args) == 0 {
89103
root.PrintHelp()

internal/cli/handle.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919
// Function to search for a Template
2020
func Search(searchTemplate string, OutputType string, Verbose bool) error {
2121
if Verbose {
22-
fmt.Printf("%sStruct Finder v%s%s\n", color.Green, finderversion.Version, color.Reset)
22+
fmt.Printf("%sStruct Finder %s%s - Buildtime: %s\n", color.Green, finderversion.Version, color.Reset, finderversion.BuildTime)
2323
}
2424

2525
templateName := searchTemplate

internal/finderversion/version.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
package finderversion
22

3-
const Version = "0.3.8"
3+
// Version for the Program
4+
// 0.3.8
5+
const Version = "DEV"
6+
const BuildTime = "Unknown"

internal/templates/templateloader.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ func getAvailableDrives() []string {
5050
// - ~/.finder/templates/
5151
// - ./.finder/templates/ (current directory)
5252
// - X:\.finder\templates/ (on Windows, for each available drive X:)
53+
//
5354
// Returns empty map if no user templates found (not an error).
5455
func LoadUserTemplates() (map[string][]byte, error) {
5556
userTemplates := make(map[string][]byte)

0 commit comments

Comments
 (0)