Hi Peter,
Sounds pretty good to me. Couple comments inline below.
Jim
On Wed, Aug 06, 2014 at 08:13:20AM -0700, Peter Hyman wrote:
> In order to improve usability of discscrub, I am beginning work on some
> enhancements and wish to get feedback on suitability.
>
> 1. Allow use of Environment Variables for setting persistent options
> (such as Pattern, Scrub Signature, Remove File, Rename Directory Entry,
> Link Target, etc.
> 2. Allow use of a conf file in /etc or user home to store persistent
> options. User conf will override all, /etc/conf will override ENV, ENV will
> set program options, command line overrides all.
I would probably set the precedence like this:
1. (lowest) compiled-in defaults
2. /etc/scrub.conf
3. ~/.scrub.conf
3. environment
4. (highest) command line
and be clear about that in the man page.
One thing about config files: writing your own parser is rarely a good idea,
but people often grab the scrub tarball in a hurry, and having to deal with
a an external package dependency (especially on non-linux platforms)
could be a problem. So...do we really want a config file?
> 3. Allow removal of multiple regular files on the command line.
> 4. Allow use of Wildcards to select multiple files
The shell would handle expanding a command line with wildcards in it,
or did you have something else in mind here? Maybe a --recursive
option would be useful...
> 5. When Multiple Files selected, force a one time interactive mode
> requiring a positive YES response
> 6. Consider adding an option to override interactive prompt (i.e. accept
> all mode)
I'm not a fan of confirmation, could we do without that one?
> Architecturally, this won't change the program much.
>
> 1. Conf files or ENV files would be loaded prior to reading the command
> line. Command line will override all.
> 2. After all options are read from argv, all additional argv items would
> be considered files
> 1. If a special file (i.e. a device), stop there and scrub the device.
> 2. For each additional argv, scrub files one at a time
> 1. If argv is a regular file, then process
> 2. If argv is a wildcartd, then glob it and process file list one
> at a time
> 3. dirent function will need some review since multiple files will
> cause a name collision
>
> Any feedback is appreciated.
I'd validate the whole command line before scrubbing anything.
Suggestion: add unit tests to exercise new functionality and keep commits
tight (one feature each).
> Peter
Thanks!
Regards,
Jim