From 39a3f095bc6eccf7e87b3a5a29a181dc63565310 Mon Sep 17 00:00:00 2001 From: Joshua Morris Date: Thu, 19 Nov 2015 00:56:33 +0000 Subject: [PATCH] Added environment variables to the commandline to make it easier to customize a docker image using docker-cron to execute a process --- main.go | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/main.go b/main.go index 9cb05aa..e4a2d89 100644 --- a/main.go +++ b/main.go @@ -49,34 +49,40 @@ SOFTWARE. ` app.Flags = []cli.Flag{ cli.StringFlag{ - Name: "seconds", - Value: "*", - Usage: "seconds: 0-59, */10", + Name: "seconds", + Value: "*", + Usage: "seconds: 0-59, */10", + EnvVar: "DC_SECS", }, cli.StringFlag{ - Name: "minutes", - Value: "*", - Usage: "minutes: 0-59, */10", + Name: "minutes", + Value: "*", + Usage: "minutes: 0-59, */10", + EnvVar: "DC_MINS", }, cli.StringFlag{ - Name: "hours", - Value: "*", - Usage: "hours: 0-23, */10", + Name: "hours", + Value: "*", + Usage: "hours: 0-23, */10", + EnvVar: "DC_HOURS", }, cli.StringFlag{ - Name: "day-of-month", - Value: "*", - Usage: "day of month: 1-31", + Name: "day-of-month", + Value: "*", + Usage: "day of month: 1-31", + EnvVar: "DC_DOM", }, cli.StringFlag{ - Name: "months", - Value: "*", - Usage: "month: 1-12 or JAN-DEC, */10", + Name: "months", + Value: "*", + Usage: "month: 1-12 or JAN-DEC, */10", + EnvVar: "DC_MONTHS", }, cli.StringFlag{ - Name: "day-of-week", - Value: "*", - Usage: "day of week: 0-6 or SUN-SAT", + Name: "day-of-week", + Value: "*", + Usage: "day of week: 0-6 or SUN-SAT", + EnvVar: "DC_DOW", }, } app.Action = func(con *cli.Context) {