All NutBox commands adhere to the following conventions:
- All commands are written in C# for .NET. I have upgraded from .NET v2.0 to v4.0 as Mono can now handle .NET v4.0.
- All commands are written using the KISS philosophy: Keep It Simple, Silly! This affects how I write my code: Rather readable and maintainable than 1/2000th of a second faster.
- If the command is invoked with one of the parameters
--help, /?, or -?, help is shown and the command exits with an error code of two (this is automatically handled by the NutBox.Options.Parser class). - If a parameter is “
--“, this means that no more options are to be parsed. This is very useful in a few, rare cases such as this: “filefind --recurse -- --recurse *.hlp | more”, which finds all occurrences of the string “--recurse” in all help text files in the current directory tree (this is automatically handled by the NutBox.Options.Parser class). - If a parameter begins with two dashes (--), then it is a long name option. Some long name options take parameters, in which case the syntax is either “--name:value” or “--name=value”.
- If the command succeeds, it returns 0 (this is handled automatically by the
NutBox.Program class). - If the command fails, it returns 1 (this is handled automatically by the
NutBox.Program class). - The commands accept standard input wherever that’s feasible and intuitive (work in progress!).
- The command reports all help text to the standard output device, not to the standard error device (makes it easier to use ‘more’ and to create log files).
- The command reports all errors to the standard error device.
- All commands use the same standard help text format (which resembles a Unix man page).
- All commands execute silently unless something goes wrong (Unix-style), except the
dircmp command, which discreetly and concisely reports the differences detected. - All commands displays the version number and copyright message if an error occurs (this makes it easier to locate the source of the problem from large logs in build systems and the like).
- All commands attempt to be consistent in output and behavior.
- All commands accept one or more response file names using the format
@filename, where filename is the name of the response file. A response file is a file that contains parameters. (This is automatically handled by the NutBox.Options.Parser class). A response file may reference other response files, but NutBox does not currently attempt to detect recursive references to response files. - All commands share the same extended .NET library (
NutBox.dll), which provides more advanced and generic features than those found in .NET. - All commands are donated to the Public Domain and thus may be used for ANYTHING you like. You may even sell it and/or claim that you made it yourself. I am fed up with licenses for "free" software and therefore decided to make NutBox truly free for everybody in all cases. Obviously, I hope that people will submit their bug fixes and enhancements to me so that I can include them in NutBox, but I expressly do not require anybody to do this. It may be that the bug fixes and/or enhancements are classified material that cannot be released to the public.
- No command ever enters into interactive mode. Not even prompts for confirmation of delete, etc. There is already one exception to this rule…:
view. Another candidate is rm.