Skip to content

Commit

Permalink
-version and -cleanAll flag, installer file
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmit0920 committed Jul 17, 2024
1 parent 1ea1035 commit 7f700d5
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
sample_files_organized/
ToDo.txt
title.txt
title.txt
LICENSE.txt
deployment/fidy.iss
Binary file added deployment/fidy_Installer.exe
Binary file not shown.
Binary file added deployment/fidy_icon.ico
Binary file not shown.
Binary file modified fidy.exe
Binary file not shown.
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ type Config struct {
Name string `json:"name"`
}

const ver = "1.2.1"

func getConfigFilePath() (string, error) {
homeDir, err := os.UserHomeDir()
if err != nil {
Expand Down Expand Up @@ -67,6 +69,7 @@ func main() {
verbose := flag.Bool("verbose", false, "Enable verbose output")
dryrun := flag.Bool("dryrun", false, "Simulate the file organization without doing any actual changes")
cleanAll := flag.Bool("cleanAll", false, "Delete all the empty folders and sub-folders in the specified directory after organizing files.")
version := flag.Bool("version", false, "Display Fidy's current version installed in your system.")

flag.Parse()

Expand Down Expand Up @@ -109,6 +112,7 @@ func main() {
fmt.Println("\nUsage:")
fmt.Println("")
fmt.Println(" -help : Show information about Fidy.")
fmt.Println(" -version : Display Fidy's current version installed in your system.")
fmt.Println(" -name <name> : Set your name to personalize Fidy's greetings.")
fmt.Println(" -dir <path> : Specify the directory to organize. Use 'fidy -dir .' for current directory.")
fmt.Println(" -include <exts> : Comma-separated list of extensions to include.")
Expand All @@ -120,6 +124,11 @@ func main() {
return
}

if *version {
fmt.Printf("\nFidy version %s\n\n", ver)
return
}

if *dir != "" {
excludeExtensions := strings.Split(*exclude, ",") // list of excluded extensions
includeExtensions := strings.Split(*include, ",") // list of included extensions
Expand Down

0 comments on commit 7f700d5

Please sign in to comment.