6 Commits (master)

Author SHA1 Message Date
Avril f918d5f6e1
Prepared or replacing return type from directly normal operation `Options` to `enum Mode`, which will facilitate returning a `--help` or other special mode case. We can use `impl From<Options> for Mode` and work with this to make the migration of return types easier.
2 years ago
Avril 227abc0d7d
args: Added visitor-pattern argument parsing. Fixed bug in `try_parse_for!()` which `continue`d on the wrong branch. Improved specific and general error messages regarding arguments. Parsing for `-exec/{}` works! A correct `Options` struct is produced, edge-and error- cases are handled correctly with informative messages (TODO: Implement `--help`.)
2 years ago
Avril 177bf3c4ff
main: Added `parse_args()`: Parses args, converts error to eyre::Report, and adds section for suggestion (TODO: Implement `--help`) and section on which args existed.
2 years ago
Avril 1e9224d53c
args: Added `parse_args()`: Attempt to parse the program args into `Options` struct. Added `ArgParseError`, error describing why parsing arguments failed. Added `EXEC_MODE_STRING_TERMINATOR` the terminator used when deciding when to stop parsing an arglist for `-exec/{}`. Added `program_name()`, returns the current executable"s name as a UTF8 string, if the executable"s name was not a UTF8 string, then it is lossily converted to one and invalid characters are replaced.
2 years ago
Avril 0b84adc84f
Added fmt::Display impl for ExecMode that quotes/escapes command or args if needed uses the `POSITIONAL_ARG_STRING` for positional arguments.
2 years ago
Avril 682cd8ec15
args::Option::ExecMode Started argument parsed data structure for `-ecec <command> [<args>...]` (Stdin) `-exec{} <command> [<args>|{}...]` (Positional `"/prof/self/fds/{}" (3++)`).
2 years ago