diff options
| author | Paul Buetow <paul@buetow.org> | 2024-10-08 10:32:13 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2024-10-08 10:32:13 +0300 |
| commit | 2bc4585db96da4000fbf727beadfc25af64bcd4a (patch) | |
| tree | 2df64b440728e198a6752323f61447aea57f73b2 /cmd | |
| parent | cb38f62ea7fe65732180805a1555bf969e9394ee (diff) | |
initial restructure for oauth2
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/gos/main.go | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/cmd/gos/main.go b/cmd/gos/main.go index 752370a..5b98386 100644 --- a/cmd/gos/main.go +++ b/cmd/gos/main.go @@ -20,25 +20,26 @@ func main() { dry := flag.Bool("dry", false, "Dry run") version := flag.Bool("version", false, "Display version") gosDir := flag.String("gosDir", "./gosdir", "Gos' directory") - secretsConfig := filepath.Join(os.Getenv("HOME"), ".config/gos/gosec.json") - secretsConfig = *flag.String("secretsConfig", secretsConfig, "Gos' secret config") + secretsConfigPath := filepath.Join(os.Getenv("HOME"), ".config/gos/gosec.json") + secretsConfigPath = *flag.String("secretsConfig", secretsConfigPath, "Gos' secret config") platforms := flag.String("platforms", "Mastodon,LinkedIn", "Platforms enabled") target := flag.Int("target", 2, "How many posts per week are the target?") lookback := flag.Int("lookback", 30, "How many days look back in time for posting history") flag.Parse() - secrets, err := config.NewSecrets(secretsConfig) + secrets, err := config.NewSecrets(secretsConfigPath) if err != nil { log.Fatal(err) } args := config.Args{ - DryRun: *dry, - GosDir: *gosDir, - Platforms: strings.Split(*platforms, ","), - Target: *target, - Lookback: time.Duration(*lookback) * time.Hour * 24, - Secrets: secrets, + DryRun: *dry, + GosDir: *gosDir, + Platforms: strings.Split(*platforms, ","), + Target: *target, + Lookback: time.Duration(*lookback) * time.Hour * 24, + SecretsConfigPath: secretsConfigPath, + Secrets: secrets, } if err := args.Validate(); err != nil { |
