cernopendata / cernopendata-client

CERN Open Data command-line client
http://cernopendata-client.readthedocs.io/
GNU General Public License v3.0
10 stars 9 forks source link

walker: enrich output with parent directories #104

Closed tiborsimko closed 3 years ago

tiborsimko commented 3 years ago

Current behaviour

When one uses recursive file list option, only the final file names are printed out:

$ cernopendata-client list-directory /eos/opendata/cms/validated-runs
2010
2011
2012
Commissioning10

$ cernopendata-client list-directory /eos/opendata/cms/validated-runs -R
Commissioning10-May19ReReco_7TeV.json
Commissioning10-May19ReReco_900GeV.json
Cert_190456-208686_8TeV_22Jan2013ReReco_Collisions12_JSON.txt
Cert_160404-180252_7TeV_ReRecoNov08_Collisions11_JSON.txt
Cert_136033-149442_7TeV_Apr21ReReco_Collisions10_JSON_v2.txt

This is a bit troublesome because the user does not know in which directory the given file is located.

Expected behaviour

The recursive output should print also parent directories, for example:

$ cernopendata-client list-directory /eos/opendata/cms/validated-runs -R
/eos/opendata/cms/validated-runs/2010/Cert_136033-149442_7TeV_Apr21ReReco_Collisions10_JSON_v2.txt
/eos/opendata/cms/validated-runs/2011/Cert_160404-180252_7TeV_ReRecoNov08_Collisions11_JSON.txt
/eos/opendata/cms/validated-runs/2012/Cert_190456-208686_8TeV_22Jan2013ReReco_Collisions12_JSON.txt
/eos/opendata/cms/validated-runs/Commissioning10/Commissioning10-May19ReReco_7TeV.json
/eos/opendata/cms/validated-runs/Commissioning10/Commissioning10-May19ReReco_900GeV.json

The users are accustomed to seeing this from their regular ls commands.