##// END OF EJS Templates
Adds an option to reposman for reading the API key from a file....
Jean-Philippe Lang -
r7837:a26db9f08c23
parent child
Show More
@@ -19,7 +19,8
19 19 # -r redmine.example.net
20 20 # -r http://redmine.example.net
21 21 # -r https://example.net/redmine
22 # -k, --key=KEY use KEY as the Redmine API key
22 # -k, --key=KEY use KEY as the Redmine API key (you can use the
23 # --key-file option as an alternative)
23 24 #
24 25 # == Options
25 26 #
@@ -50,6 +51,9
50 51 # and subversion.
51 52 # -f, --force force repository creation even if the project
52 53 # repository is already declared in Redmine
54 # --key-file=PATH path to a file that contains the Redmine API key
55 # (use this option instead of --key if you don't
56 # the key to appear in the command line)
53 57 # -t, --test only show what should be done
54 58 # -h, --help show help and exit
55 59 # -v, --verbose verbose
@@ -73,6 +77,7 opts = GetoptLong.new(
73 77 ['--svn-dir', '-s', GetoptLong::REQUIRED_ARGUMENT],
74 78 ['--redmine-host', '-r', GetoptLong::REQUIRED_ARGUMENT],
75 79 ['--key', '-k', GetoptLong::REQUIRED_ARGUMENT],
80 ['--key-file', GetoptLong::REQUIRED_ARGUMENT],
76 81 ['--owner', '-o', GetoptLong::REQUIRED_ARGUMENT],
77 82 ['--group', '-g', GetoptLong::REQUIRED_ARGUMENT],
78 83 ['--url', '-u', GetoptLong::REQUIRED_ARGUMENT],
@@ -134,6 +139,13 begin
134 139 when '--svn-dir'; $repos_base = arg.dup
135 140 when '--redmine-host'; $redmine_host = arg.dup
136 141 when '--key'; $api_key = arg.dup
142 when '--key-file'
143 begin
144 $api_key = File.read(arg).strip
145 rescue Exception => e
146 $stderr.puts "Unable to read the key from #{arg}: #{e.message}"
147 exit 1
148 end
137 149 when '--owner'; $svn_owner = arg.dup; $use_groupid = false;
138 150 when '--group'; $svn_group = arg.dup; $use_groupid = false;
139 151 when '--url'; $svn_url = arg.dup
General Comments 0
You need to be logged in to leave comments. Login now