Compare commits

..

No commits in common. "f2976c66e3c93c2033b40698d5a5e5aec42dfb5d" and "15f7db8d3e673b81428f578fb9c495b86b487510" have entirely different histories.

2 changed files with 3 additions and 14 deletions

2
.gitignore vendored
View File

@ -1,2 +0,0 @@
**/__debug_bin*
main

View File

@ -3,10 +3,8 @@ package main
import ( import (
"flag" "flag"
"fmt" "fmt"
"os"
"git.schreifuchs.ch/schreifuchs/pat/pkg/cat" "git.schreifuchs.ch/schreifuchs/pat/pkg/cat"
"git.schreifuchs.ch/schreifuchs/pat/pkg/clip"
"git.schreifuchs.ch/schreifuchs/pat/pkg/ignore" "git.schreifuchs.ch/schreifuchs/pat/pkg/ignore"
) )
@ -20,15 +18,13 @@ func main() {
cats, err := cat.Path(flag.Args()...) cats, err := cat.Path(flag.Args()...)
if err != nil { if err != nil {
fmt.Println(err.Error()) panic(err)
os.Exit(1)
} }
if *ignorePath != "" { if *ignorePath != "" {
i, err := ignore.FindGitignore(*ignorePath) i, err := ignore.FindGitignore(*ignorePath)
if err != nil { if err != nil {
fmt.Printf("can't get gitignore: %v", err) panic(err)
os.Exit(1)
} }
cats = cats.Ignored(i) cats = cats.Ignored(i)
@ -37,11 +33,6 @@ func main() {
cats = cats.Ignored(ignore.Filesystem{}) cats = cats.Ignored(ignore.Filesystem{})
} }
out := cats.ToString(DELEMITTER) fmt.Print(cats.ToString(DELEMITTER))
fmt.Print(out)
if err = clip.Copy(out); err != nil {
fmt.Println(err.Error())
os.Exit(1)
}
} }