##// END OF EJS Templates
Adds an option to rdm-mailhandler for reading the API key from a file (#4976)....
Jean-Philippe Lang -
r7834:d3a25649649a
parent child
Show More
@@ -22,6 +22,10
22 # create: create a user account
22 # create: create a user account
23 # --no-permission-check disable permission checking when receiving
23 # --no-permission-check disable permission checking when receiving
24 # the email
24 # the email
25 # --key-file=PATH path to a file that contains the Redmine
26 # API key (use this option instead of --key
27 # if you don't the key to appear in the
28 # command line)
25 # --no-check-certificate do not check server certificate
29 # --no-check-certificate do not check server certificate
26 # -h, --help show this help
30 # -h, --help show this help
27 # -v, --verbose show extra information
31 # -v, --verbose show extra information
@@ -87,6 +91,7 class RedmineMailHandler
87 [ '--verbose', '-v', GetoptLong::NO_ARGUMENT ],
91 [ '--verbose', '-v', GetoptLong::NO_ARGUMENT ],
88 [ '--url', '-u', GetoptLong::REQUIRED_ARGUMENT ],
92 [ '--url', '-u', GetoptLong::REQUIRED_ARGUMENT ],
89 [ '--key', '-k', GetoptLong::REQUIRED_ARGUMENT],
93 [ '--key', '-k', GetoptLong::REQUIRED_ARGUMENT],
94 [ '--key-file', GetoptLong::REQUIRED_ARGUMENT],
90 [ '--project', '-p', GetoptLong::REQUIRED_ARGUMENT ],
95 [ '--project', '-p', GetoptLong::REQUIRED_ARGUMENT ],
91 [ '--status', '-s', GetoptLong::REQUIRED_ARGUMENT ],
96 [ '--status', '-s', GetoptLong::REQUIRED_ARGUMENT ],
92 [ '--tracker', '-t', GetoptLong::REQUIRED_ARGUMENT],
97 [ '--tracker', '-t', GetoptLong::REQUIRED_ARGUMENT],
@@ -104,6 +109,13 class RedmineMailHandler
104 self.url = arg.dup
109 self.url = arg.dup
105 when '--key'
110 when '--key'
106 self.key = arg.dup
111 self.key = arg.dup
112 when '--key-file'
113 begin
114 self.key = File.read(arg).strip
115 rescue Exception => e
116 $stderr.puts "Unable to read the key from #{arg}: #{e.message}"
117 exit 1
118 end
107 when '--help'
119 when '--help'
108 usage
120 usage
109 when '--verbose'
121 when '--verbose'
General Comments 0
You need to be logged in to leave comments. Login now