Skip to content

Accept sizes with k/M/G/T/E suffixes.#194

Open
JurjenBokma wants to merge 1 commit intopauldreik:mainfrom
JurjenBokma:accept-size-suffixes
Open

Accept sizes with k/M/G/T/E suffixes.#194
JurjenBokma wants to merge 1 commit intopauldreik:mainfrom
JurjenBokma:accept-size-suffixes

Conversation

@JurjenBokma
Copy link
Copy Markdown

Change

Have file and buffer size options accept arguments like '2k', '6M', '20G'.

Reasoning

I typed something like: rdfind -minsize 1G . and got confusing output until I figured the 'G' suffix was not supported.
I would like such file size suffixes to work.

Testing

To my shame, I did only cursorily test the new feature, and neglected to re-run the tests already present.

Note

Thank you for sharing rdfind. Having to dedup a few TB on disk, I found it useful.

@JurjenBokma
Copy link
Copy Markdown
Author

JurjenBokma commented May 28, 2025

Fixes #134
All tests still pass.

Comment thread CmdlineParser.cc
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <stdexcept>
Copy link
Copy Markdown
Author

@JurjenBokma JurjenBokma May 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

File size conversion throws runtime_error on invalid suffix. So we need to include stdexcept.

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.

1 participant