Optionally, output the CSV stream on stdout, allowing user to rename
file via redirect. This would basically be filter functionality via arg.
Note that this would allow make_file_path_unique to be moved out of main if desired.
Remember that there isn't really a meaningfully Pure version of the main function.
All it would do is:
Take checksum_paths's return value as an arg.
Sort it.
Call find_dupes on it.
Return find_dupe's value
So main probably shouldn't be pure, but it would be more usefully modular if
it only ever needed to return one kind of output, a dictionary.
Ideally its return tuple shouldn't contain anything that wasn't useful for another generalized
sort of app. So, does that mean it shouldn't pass through a filter arg?
What if instead of passing the whole args namespace object to the main function
we made the main function take just one or two args. Like:
args.starting_folder
args.progress
So that we could:
Call get_listdupes_args
Pass args.starting_folder and args.progress to main.
Test args.filter to see if main's output should be written to disk or streamed to stdout.
The advantage of this:
The module would have main as a single convenience function developers could call
with a path and which would return a dictionary.
When used as a terminal command the app could behave in a more filter-like capacity.
By outputting a stream of CSV. It could even potentially take a stream of paths as input
Idea for further modularizing the app:
Note that this would allow make_file_path_unique to be moved out of main if desired.
Remember that there isn't really a meaningfully Pure version of the main function. All it would do is:
So main probably shouldn't be pure, but it would be more usefully modular if it only ever needed to return one kind of output, a dictionary.
Ideally its return tuple shouldn't contain anything that wasn't useful for another generalized sort of app. So, does that mean it shouldn't pass through a filter arg?
What if instead of passing the whole args namespace object to the main function we made the main function take just one or two args. Like:
So that we could:
The advantage of this: