Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make it installable via go install #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions cmd/clean.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package cmd

import (
"github.com/Navid2zp/dups"
"fmt"
"github.com/spf13/cobra"
"log"
"os"

"github.com/Navid2zp/dups/dups"
"github.com/spf13/cobra"
)

// clean command
Expand All @@ -44,8 +45,8 @@ You can add '>> file.txt' at the end to export the result into a text file
log.Fatal("please provide a directory path not a file path")
}
singleCore, _ := cmd.Flags().GetBool("single-core") // single core option
fullSearch, _ := cmd.Flags().GetBool("full") // full search option
minSize, _ := cmd.Flags().GetInt("min-size") // minimum file size to scan
fullSearch, _ := cmd.Flags().GetBool("full") // full search option
minSize, _ := cmd.Flags().GetInt("min-size") // minimum file size to scan
flat, _ := cmd.Flags().GetBool("flat")
algorithm, err := cmd.Flags().GetString("algorithm")
algorithm = dups.GetAlgorithm(algorithm)
Expand Down
4 changes: 2 additions & 2 deletions cmd/gomaxprocs.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
The default runtime.GOMAXPROCS in go >= 1.5 will be the number of cpu cores (runtime.NumCPU())
This is just in case that someone builds the package in go < 1.5
Use multicore tag (go build -tags multicore) while building if using go < 1.5 for multi-core support
*/
package main
*/
package cmd

import "runtime"

Expand Down
5 changes: 0 additions & 5 deletions cmd/main.go

This file was deleted.

2 changes: 1 addition & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package cmd

import (
"fmt"
Expand Down
6 changes: 3 additions & 3 deletions cmd/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
package cmd

import (
"bufio"
Expand All @@ -24,7 +24,7 @@ import (

"github.com/spf13/cobra"

"github.com/Navid2zp/dups"
"github.com/Navid2zp/dups/dups"
)

var scanCmd = &cobra.Command{
Expand Down
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package main

import (
"github.com/Navid2zp/dups/cmd"
)

func main() {
cmd.Execute()
}