openmicroscopy/openmicroscopy — pull request #3009 by ximenesuk (2014-09-04 18:14:01+00:00)
Title: Add a disk usage plugin

This PR supersedes both gh-2945 and gh-2960.

The main part of this PR utilises the work in gh-2919 to provide a summary of disk usage by object type:
```
bin/omero usage Image:1,2,3 --report
Using session b011dfc4-2d21-4898-b72b-0a366891414a (user-0@localhost:4064). Idle timeout: 10.0 min. Current group: pg-0
Total disk usage: 153629 bytes
component | size
--------------+-------
Job | 59124
Annotation | 8
FilesetEntry | 90432
Thumbnail | 4065
(4 rows)
```

Part of this PR provides a method to remove the sorting from the cli usage when an incorrect option is given. This is useful order of the choices can be significant. See:https://github.com/openmicroscopy/openmicroscopy/pull/2945#issuecomment-52752080 The only subcommand using this method is `fs usage`, there the `--units` should be ordered by size while all other cli commands should be unaffected. To test try:
```
bin/omero fs usage Experimenter:0 --units Z
```
and, at least,
```
bin/omero foo
```

This PR has made some potentially significant changes on the `fs` command. The other subcommands all appear to work as before and all relevant unit and integration tests pass. However, part of testing this PR should involve checking the other `fs` subcommands.

TODO: Help comments and unit/integrations tests are still to be added as well as some changes to functionality following the conversation in gh-2945