go build main.go
env | default | accepts |
---|---|---|
ROOTDIR | C:\ | string |
MAXDEBTH | 10 | int |
SILENT | 1 | bool |
REGEX | 1 | bool |
In Powershell
$env:MAXDEBTH=10
$env:SILENT=0
$env:REGEX=1
$env:ROOTDIR='C:\'
.\main.exe
In Bash
MAXDEBTH=10 SILENT=0 REGEX=1 ROOTDIR='C:\' ./main
Listing all .mp4 files using regex
^*.mp4$
This example will open 1080p.mp4
inside the file explorer
-> ^*.mp4$
[1] HolidayJazz.mp4
[2] 1080p.mp4
[3] 1080p3min.mp4
[4] 1080p60.mp4
[5] 360p.mp4
[6] 480p.mp4
[7] 720p.mp4
Found 7 matches in 12ms
-> --open 2
Opening: C:\tmp\
->
This example will copy 1080p.mp4
into the folder beans
-> ^*.mp4$
[1] HolidayJazz.mp4
[2] 1080p.mp4
[3] 1080p3min.mp4
[4] 1080p60.mp4
[5] 360p.mp4
[6] 480p.mp4
[7] 720p.mp4
Found 7 matches in 12ms
-> --copy 2 ./beans
->
This example will output all available commands
-> --help
#########################
# search_go | help page #
#########################
--open [number] # requires a number
--open 69 # opens the 69th file from the matched files & folders in the explorer
--limit [number] # requires a number
--limit 100 # list only the first 100 matches (set to 0 if you want no limit)
--copy [number|*] # requires a number or *
--copy 100 ./destfolder # copies the 100th file into the destfolder
--copy * ./destfolder # copies the all matched files into the destfolder
->
regex
BenchmarkMP4Search\/input_size_([0-9]{1,})-8[ ]{1,}[0-9][ ]{1,}([0-9]{1,}) ns\/op[ ]{1,}([0-9]{1,}) B\/op[ ]{1,}([0-9]{1,}) allocs\/op
csv
$1,$2,$3,$4
run
go test -benchmem -run=^$ -count 3 -bench ^BenchmarkMP4Search$ com/github/kirari04/search_go/benchmark