Skip to content

Commit

Permalink
feat(README): updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Wittano committed Dec 17, 2023
1 parent 9b55226 commit 8ad1f29
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 6 deletions.
45 changes: 44 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,45 @@
# FileBot
FileBot is simple file manager to automation your boring action with files e.g. moving to trash, another directory or renaming files

FileBot is simple file manager to automation your boring action with files e.g. moving to trash or another director

# Configuration

## Flags

```text
Usage:
filebot [flags]
Flags:
-c, --config string specific path for filebot configuration (default "/home/wittano/.config/filebot/setting.toml")
-h, --help help for filebot
-l, --log string path to log file
--logLevel string log level (default "INFO")
-u, --updateInterval duration set time after filebot should be refresh watched file state (default 10m0s)
```

## Configuration file

```toml
# Example configuration for moving some files to another location
[Example]
src = ["/path/to/example.txt"]
dest = "/path/to/destination/directory"

# You can use standard regular expression seeking your files
[SearchFilesByRegex]
src = ["/path/to/example.*", "/path/to/[0-9]ystem.txt"]
dest = "/path/to/destination/directory"

# Automaticlly move your unnecessary files to Trash directory
[MoveToTrash]
src = ["/path/to/your/junk-file.*"]
moveToTrash = true
after = 32 # Time a last modification(in days), after that files will be moved to trash

# Some files you don't want to move or touch by program. You can add specified file to exception list
[Exception]
src = ["/some/files.*"]
dest = "/path/to/desctination"
exceptions = ["files.pdf", "files.ini"] # Put only file name
```
8 changes: 4 additions & 4 deletions cmd/filebot/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ var (
)

func init() {
rootCmd.PersistentFlags().StringVarP(&setting.Flags.ConfigPath, "setting", "c", setting.DefaultConfigPath(), "Specific path for filebot configuration")
rootCmd.PersistentFlags().StringVarP(&setting.Flags.LogFilePath, "log", "l", "", "Path to log file")
rootCmd.PersistentFlags().StringVarP(&setting.Flags.LogLevelName, "logLevel", "", "INFO", "Log level")
rootCmd.PersistentFlags().DurationVarP(&setting.Flags.UpdateInterval, "updateInterval", "u", setting.DefaultUpdateInterval(), "Set time after filebot should be refresh watched file state")
rootCmd.PersistentFlags().StringVarP(&setting.Flags.ConfigPath, "config", "c", setting.DefaultConfigPath(), "specific path for filebot configuration")
rootCmd.PersistentFlags().StringVarP(&setting.Flags.LogFilePath, "log", "l", "", "path to log file")
rootCmd.PersistentFlags().StringVarP(&setting.Flags.LogLevelName, "logLevel", "", "INFO", "log level")
rootCmd.PersistentFlags().DurationVarP(&setting.Flags.UpdateInterval, "updateInterval", "u", setting.DefaultUpdateInterval(), "set time after filebot should be refresh watched file state")

v := validator.New(validator.WithRequiredStructEnabled())
if err := v.Struct(setting.Flags); err != nil {
Expand Down
2 changes: 1 addition & 1 deletion setting/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func DefaultConfigPath() string {
}

// TODO Change config file from TOML to YAML
return filepath.Join(homeDir, ".setting", "filebot", "setting.toml")
return filepath.Join(homeDir, ".config", "filebot", "setting.toml")
}

func DefaultUpdateInterval() time.Duration {
Expand Down

0 comments on commit 8ad1f29

Please sign in to comment.