sshfs-mapper config: Added default action.

git-svn-id: https://websvn.glenux.net/svn/Upoc/sshfs-mapper/trunk@1665 eaee96b3-f302-0410-b096-c6cfd47f7835
This commit is contained in:
Glenn Y. Rolland 2011-03-15 16:57:02 +00:00
parent 9a480130ab
commit 4d0af395ee

View file

@ -14,13 +14,13 @@ module SshfsMapper
attr_reader :maps_active
attr_reader :maps
attr_reader :action
ACTION_UMOUNT = :umount
ACTION_MOUNT = :mount
ACTION_INIT = :init
def initialize
@action = ACTION_MOUNT
user = if ENV['USER'] then
ENV['USER']
@ -40,6 +40,7 @@ module SshfsMapper
home_dir + '/.config'
end
@action = ACTION_MOUNT
@config_dir = xdg_dir + '/sshfs-mapper'
@config_file = nil
@maps = []
@ -53,7 +54,7 @@ module SshfsMapper
def parse_file &blk
rdebug "Config: #{@config_dir}/config"
maps = []
@maps = []
Find.find( @config_dir ) do |path|
if File.file? path
if File.basename( path ) =~ /.map$/
@ -68,7 +69,6 @@ module SshfsMapper
#total_size += FileTest.size(path)
end
end
return maps
end
def parse_cmd_line args