def info_file(*args)
unless args[0]
info_files
return
end
file = args[0]
param = args[1]
param = 'basic' unless param
subcmd = find(InfoFileSubcommands, param)
unless subcmd
errmsg "Invalid parameter #{param}\n"
return
end
unless LineCache::cached?(file)
unless LineCache::cached_script?(file)
print "File #{file} is not cached\n"
return
end
LineCache::cache(file, Command.settings[:reload_source_on_change])
end
print "File %s", file
path = LineCache.path(file)
if %w(all basic path).member?(subcmd.name) and path != file
print " - %s\n", path
else
print "\n"
end
if %w(all basic lines).member?(subcmd.name)
lines = LineCache.size(file)
print "\t %d lines\n", lines if lines
end
if %w(all breakpoints).member?(subcmd.name)
breakpoints = LineCache.trace_line_numbers(file)
if breakpoints
print "\tbreakpoint line numbers:\n"
print columnize(breakpoints.to_a.sort, self.class.settings[:width])
end
end
if %w(all mtime).member?(subcmd.name)
stat = LineCache.stat(file)
print "\t%s\n", stat.mtime if stat
end
if %w(all sha1).member?(subcmd.name)
print "\t%s\n", LineCache.sha1(file)
end
end