odeke-em / drive

Google Drive client for the commandline
Apache License 2.0
6.68k stars 426 forks source link

"drive list -long -depth 0 $folder" does not return anything #841

Open jean-christophe-manciot opened 7 years ago

jean-christophe-manciot commented 7 years ago

It works fine with a file, but not with a folder:

# drive list -long -depth 0 -hidden -no-prompt Test/Trash.jpg
-- owner       72.70KB      0B6XxNd5c3zV_WGZZVDhCV01DbDQ        2017-01-10 13:59:51 +0000 UTC   /Missions/Certifications/IPv6 Forum/Test/Trash.jpg
# drive list -long -depth 0 -hidden -no-prompt Test
#

No such issue with drive stat

# drive stat -depth 0 -hidden  Test

/Missions/Certifications/IPv6 Forum/Test
Filename                  Test                          
FileId                    0B6XxNd5c3zV_TzVxVHRJWnNJOEU  
Bytes                     0                             
Size                      0.00B                         
DirType                   folder                        
VersionNumber             9558145                       
MimeType                  application/vnd.google-apps.folder
Etag                      "m64ksZC09nG4-fB1IRhNTNcF3vg/MTQ4MzcxNDc5MTAwMA"
ModTime                   2017-01-06 14:59:51 +0000 UTC 
LastViewedByMe            2017-01-10 13:59:30 +0000 UTC 
Shared                    false                         
Owners                    jean-christophe Manciot       
LastModifyingUsername     jean-christophe Manciot       
OriginalFilename                                        
Starred                   false                         
Viewed                    true                          
Trashed                   false                         
ViewersCanDownload        false                         

*
Name: jean-christophe Manciot <manciot.jeanchristophe@gmail.com>
Role                 owner                         
AccountType          user                          
*
odeke-em commented 7 years ago

Hello @jean-christophe-manciot, --depth is meant to traverse the contents of the subject item or display it if isn't a folder, when you do list because list inherently just uses the folder to get to its children. For stat, a folder's information is displayed because stat first details the subject item first and then tries to traverse to the children.

Would you mind telling me what output were you expecting for drive list --depth 0 folder?

jean-christophe-manciot commented 7 years ago

The title is incomplete; I meant ""drive list -long -depth 0 $folder" does not return anything". That means I was expecting the same infos as with a file: type, id, date & time. This is used in scripts where we don't know in advance the type of object we're dealing with.