Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to output file size and date/times in a machine readable format #139

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

athena-metis
Copy link

The usual command flag would be -h to make it human readable but as this is already the default behaviour implementing it in this way would require a change to existing functionality that others may rely on. This change is to add a slightly less conventional switch to allow the output to be more friendly to integrating with scripts.

The change allows for a -m / --machine flag for rev/search/ls commands which will output the file size in bytes and the date in a standard format rather than "X hours ago" etc. This allows for use in scripts where you want to compare a file size or check the modified date (separate PR for maintaining this when uploading via the put command)

The -m / --machine switch implies -l / --long as the standard ls output doesn't include any humanised information anyway.

Existing long output

$ dbxcli ls -l
Revision              Size  Last modified Path
5a3f4f259f9d3554dee35 548 B 2 hours ago   /LICENSE
$ dbxcli ls -m
Revision              Size Last modified                 Path
5a3f4f259f9d3554dee35 548  2020-04-23 13:08:36 +0000 UTC /LICENSE

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants