summaryrefslogtreecommitdiff
path: root/tool
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-23 09:36:22 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-23 09:36:22 (GMT)
commit80000c534c179add12eb91010feaa7b43b6abec1 (patch)
treef0be29d813557fb3a3a2a25f74d6b2a2854d21cc /tool
parentb8081c7c4c9d959a4646d08c6b50dcf6318821c0 (diff)
file2lastrev.rb: format for modified
* tool/file2lastrev.rb: add optional argument to --modified, for strftime format. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rwxr-xr-xtool/file2lastrev.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/tool/file2lastrev.rb b/tool/file2lastrev.rb
index 39b3d63..13f9a3b 100755
--- a/tool/file2lastrev.rb
+++ b/tool/file2lastrev.rb
@@ -17,6 +17,7 @@ def self.output=(output)
end
@suppress_not_found = false
+format = '%Y-%m-%dT%H:%M:%S%z'
srcdir = nil
parser = OptionParser.new {|opts|
opts.on("--srcdir=PATH", "use PATH as source directory") do |path|
@@ -31,8 +32,9 @@ parser = OptionParser.new {|opts|
opts.on("--doxygen", "Doxygen format") do
self.output = :doxygen
end
- opts.on("--modified", "modified time") do
+ opts.on("--modified[=FORMAT]", "modified time") do |fmt|
self.output = :modified
+ format = fmt if fmt
end
opts.on("-q", "--suppress_not_found") do
@suppress_not_found = true
@@ -67,7 +69,7 @@ parser.parse! rescue abort "#{File.basename(Program)}: #{$!}\n#{parser}"
}
when :modified
proc {|last, changed, modified|
- modified.strftime('%Y-%m-%dT%H:%M:%S%z')
+ modified.strftime(format)
}
else
raise "unknown output format `#{@output}'"