aboutsummaryrefslogtreecommitdiff
path: root/cmd/galleryd/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/galleryd/main.go')
-rw-r--r--cmd/galleryd/main.go25
1 files changed, 21 insertions, 4 deletions
diff --git a/cmd/galleryd/main.go b/cmd/galleryd/main.go
index 319b6b6..f1643c5 100644
--- a/cmd/galleryd/main.go
+++ b/cmd/galleryd/main.go
@@ -18,10 +18,29 @@ import (
)
func main() {
- addr := flag.String("addr", ":8082", "HTTP listen address")
+ addr := flag.String(
+ "addr",
+ ":8082",
+ "HTTP listen address",
+ )
+
+ var dirs stringSliceFlag
+
+ flag.Var(
+ &dirs,
+ "dir",
+ "gallery directory (may be specified multiple times)",
+ )
flag.Parse()
+ if len(dirs) == 0 {
+ dirs = append(
+ dirs,
+ filepath.Join(os.Getenv("HOME"), "Pictures"),
+ )
+ }
+
ctx, stop := signal.NotifyContext(
context.Background(),
os.Interrupt,
@@ -30,9 +49,7 @@ func main() {
defer stop()
scanner := scanner.New(scanner.Config{
- Roots: []string{
- filepath.Join(os.Getenv("HOME"), "Pictures"),
- },
+ Roots: dirs,
})
reader := metadata.New()