TODO in shellopts-1.0.1 vs TODO in shellopts-2.0.0.pre.1

- old
+ new

@@ -1,16 +1,32 @@ TODO + o Add validation block to ShellOpts class methods + o Get rid of key_name. Define #name on Grammar::Node instead + o Define #name to the string name of the option/command without prefixed '--' + for options. This can cause collisions but they can be avoided using aliases + o Clean-up + o Grammar::options -> Grammar::option_multihash + o Clean-up identifiers etc. + o Un-multi-izing Grammar::option_multihash and turn it into a regular hash from key to option + o subcommand vs. command consistency + o Implement ObjectStruct#key! and ObjectStruct#value! (?) + o Allow command_alias == nil to suppress the method + o Raise on non-existing names/keys. Only return nil for declared names/keys that are not present + o Use hash_tree o Also allow assignment to usage string for ShellOpts::ShellOpts objects o Create a ShellOpts.args method? It would be useful when processing commands: case opt when "command" call_command_method(ShellOpts.args[1], ShellOpts.args[2]) end ShellOpts.args would be a shorthand for ShellOpts.shellopts.args Another option would be to create an argument-processing method: shellopts.argv(2) -> call error if not exactly two arguments else return elements - + o Add a ShellOpts.option method: + file = ShellOpts.option("--file") + This will only work for options on the outermost level... maybe: + file = ShellOpts.option("load! --file") o Check on return value from #process block to see if all options was handled: case opt when '-v'; verbose = true # Return value 'true' is ok # Unhandled option means return value is nil end