Riyyi 2fca315557 Util: Add support for stdin and | piping
In order to accomplish this, the arguments have to be stored in the
object. Because () evaluation order is not defined in the spec.

Because arguments have to be stored now, char pointers no longer work
and std::strings are stored instead. Systems object also cant be
returned as a reference anymore because you need to be able to know
which is the lhs and which is the rhs in the operator overloads.
2021-09-16 18:11:47 +02:00
2021-09-04 21:12:20 +02:00
2021-09-04 21:12:20 +02:00
2021-09-04 21:12:20 +02:00
2021-09-04 21:12:20 +02:00
2021-09-04 21:12:20 +02:00

Stowage

Needed information for generation:

  • short option
  • long option
  • short description (for usage ouput)
  • long description (for manpage output)

Option Parsing

Parsed from left to right.

Types

  • Short option
  • Long option
  • Argument to option
  • Non-option parameter (default argument)

Short Option

'-' followed by short option character. If option has required argument, directly after OR separated by white-space. Optional argument must be directly after the option character.

Possible to write several short options after one '-', if all (except last) do not have required or optional arguments.

Long Option

'' followed by long option name. If option has a required argument, directly after, separated by '' OR white-space. Optional argument must be directly after the option, separated by ''.

Non-option Parameter

Each parameter not starting with '-' and not a required argument of a previous option, is a non-option parameter.

Each parameter after a '' parameter is always interpreted as a non-option parameter.

Examples

./stowage -Fals
./stowage -F -a -l -s

./stowage --file --add --pull --push

./stowage -r filename
./stowage -rfilename
./stowage --remove=filename
./stowage --remove filename

./stowage --remove filename other stuff
./stowage --remove filename -- other stuff

Multiple of the same options

./stowage -e pattern1 -epattern2 --regexp=pattern3 --regexp pattern4

TODO

  • after first non option, go into no-option mode
  • support '' to go into no-option mode
  • add multi-option support, vectors!
  • support argument parsing + storing
  • add addOption overloads
  • generate usage string
  • generate man page string
  • parse() function to return bool true if any error has occured
S
Description
Config file and package tracking utility
Readme
1.9 MiB
Languages
C++ 93.7%
CMake 6.3%