Changeset 115 for trunk/lua/cli.lua


Ignore:
Timestamp:
01/23/12 05:47:33 (16 months ago)
Author:
reyalp
Message:

move make_camera_path to fsutil

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lua/cli.lua

    r111 r115  
    265265end 
    266266 
    267 -- add/correct A/ as needed, replace \ with / 
    268 function cli:make_camera_path(path) 
    269         if not path then 
    270                 return 'A/' 
    271         end 
    272         -- fix slashes 
    273         path = string.gsub(path,'\\','/') 
    274         local pfx = string.sub(path,1,2) 
    275         if pfx == 'A/' then 
    276                 return path 
    277         end 
    278         if pfx == 'a/' then 
    279                 return 'A' .. string.sub(path,2,-1) 
    280         end 
    281         return 'A/' .. path 
    282 end 
    283  
    284267cli:add_commands{ 
    285268        { 
     
    520503                        -- no dst, use filename of source 
    521504                        if dst then 
    522                                 dst = cli:make_camera_path(dst) 
     505                                dst = fsutil.make_camera_path(dst) 
    523506                                if string.find(dst,'[\\/]$') then 
    524507                                        -- trailing slash, append filename of source 
     
    543526                                end 
    544527                        else 
    545                                 dst = cli:make_camera_path(fsutil.basename(src)) 
     528                                dst = fsutil.make_camera_path(fsutil.basename(src)) 
    546529                        end 
    547530 
     
    592575                        end 
    593576 
    594                         src = cli:make_camera_path(src) 
     577                        src = fsutil.make_camera_path(src) 
    595578                        if not args.nolua then 
    596579                                local src_st,err = con:stat(src) 
     
    734717                        local listops 
    735718                        local path=args[1] 
    736                         path = cli:make_camera_path(path) 
     719                        path = fsutil.make_camera_path(path) 
    737720                        if args.l then 
    738721                                listopts = { stat='*' } 
     
    781764                        local bootfile=args[1] 
    782765                        if bootfile then 
    783                                 bootfile = cli:make_camera_path(bootfile) 
     766                                bootfile = fsutil.make_camera_path(bootfile) 
    784767                                bootfile = string.format("'%s'",bootfile) 
    785768                        else 
Note: See TracChangeset for help on using the changeset viewer.