TritonDataCenter / python-manta

Python SDK for Manta (community maintained)
MIT License
25 stars 18 forks source link

add ls -lX option to show human-readable size #5

Closed pijewski closed 11 years ago

pijewski commented 11 years ago

For this new option, I used -X (extended?) to show the size since ls -lh was conflicting with the top-level -h option. Trent, I'll leave it to you to resolve the -h collision.

Here's an example of ls -lX:

[https://manta-beta.joyentcloud.com/bpijewski/public/mantash_test]$ ls -l
   object  bpijewski  1719664640  Sat Jan  5 01:58:16 2013  1.7g-file
   object  bpijewski    102400  Sat Jan  5 01:58:17 2013  100k-file
   object  bpijewski     10240  Sat Jan  5 01:58:18 2013  10k-file
   object  bpijewski  1073741824  Sat Jan  5 01:58:43 2013  1g-file
   object  bpijewski      1024  Sat Jan  5 01:58:44 2013  1k-file
   object  bpijewski   1048576  Sat Jan  5 01:58:45 2013  1m-file
   object  bpijewski  209715200  Sat Jan  5 01:58:50 2013  200m-file
   object  bpijewski       512  Sat Jan  5 01:58:51 2013  512-file
   object  bpijewski   5242880  Sat Jan  5 01:58:52 2013  5m-file
[https://manta-beta.joyentcloud.com/bpijewski/public/mantash_test]$ ls -lX
   object  bpijewski  1.6G  Sat Jan  5 01:58:16 2013  1.7g-file
   object  bpijewski  100K  Sat Jan  5 01:58:17 2013  100k-file
   object  bpijewski   10K  Sat Jan  5 01:58:18 2013  10k-file
   object  bpijewski  1.0G  Sat Jan  5 01:58:43 2013  1g-file
   object  bpijewski  1.0K  Sat Jan  5 01:58:44 2013  1k-file
   object  bpijewski  1.0M  Sat Jan  5 01:58:45 2013  1m-file
   object  bpijewski  200M  Sat Jan  5 01:58:50 2013  200m-file
   object  bpijewski   512  Sat Jan  5 01:58:51 2013  512-file
   object  bpijewski  5.0M  Sat Jan  5 01:58:52 2013  5m-file
trentm commented 11 years ago

Fixed the '-h' conflict and the floating-point for <10 bytes and pushed. I'll release this in 1.2.2. Thanks!

trentm commented 11 years ago

https://github.com/joyent/python-manta/commit/edac35a2f2b0076af87f76c5aa68a78378b8f4a0