Closed tiborsimko closed 2 years ago
It looks like this was a pre-meditated decision. To get machine-friendly values one can use the --report
flag.
I think we should change it, because it looks as if the -h
option is currently not doing anything. Moreover, we are loosing the analogy with du -h
. I guess we have basically two options:
If we'd like to retain the -h
option, then the default output behaviour should be raw units, and -h
would switch on the human-readable mode, so to speak, for all command reporting options and all CPU and Disk resource types.
If we'd like to retain printing human-readable values by default, then we should remove the -h
option, and rather introduce a new --raw
option to display raw units.
Basically, either raw output or human output should be "on demand", but not once this one that, for consistency's sake.
P.S. The former alternative retains the analogy with du -h
, so I guess I'd favour that one...
Assuming we want to go for option 1.
, would it be ok to print just an integer for the raw output? E.g.
$ reana-client quota-show --resource disk
1577259
$ reana-client quota-show --resource disk -h
1.5 MiB used
Otherwise, I think we'll have issues getting the basic unit string, i.e. bytes
, as for other resources it'd different. Trying to avoid harcoded strings here.
Yes, printing raw numbers is OK. This will be exactly like reana-client du -w myworkflow
, so nicely consistent.
Current behaviour
The human-readable flag has no effect:
Expected behaviour
The values should be more exact, aka machine-friendly without
-h
flag, and human-friendly with-h
flag, for example:Following
df
anddf -h
example.