Skip to main content
edited body
Source Link
ilkkachu
  • 147.9k
  • 16
  • 268
  • 441

The getopts utility does not know about mandatory options, only about what options are allowed (and what options out of these should take an option argument). If you want to enforce mandatory options, you would have to do so with your own tests in or after the option parsing loop.

The getopts utility does not do this because options can have more complex relationships such as some options conflicting, some options requiring the precensepresence of other options etc. This is left to to the script author to sort out with their own logic.

The getopts utility does not know about mandatory options, only about what options are allowed (and what options out of these should take an option argument). If you want to enforce mandatory options, you would have to do so with your own tests in or after the option parsing loop.

The getopts utility does not do this because options can have more complex relationships such as some options conflicting, some options requiring the precense of other options etc. This is left to to the script author to sort out with their own logic.

The getopts utility does not know about mandatory options, only about what options are allowed (and what options out of these should take an option argument). If you want to enforce mandatory options, you would have to do so with your own tests in or after the option parsing loop.

The getopts utility does not do this because options can have more complex relationships such as some options conflicting, some options requiring the presence of other options etc. This is left to to the script author to sort out with their own logic.

added 63 characters in body
Source Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k

The getopts utility does not know about mandatory options, only about what options are allowed (and what options out of these should take an option argument). If you want to enforce mandatory options, you would have to do so with your own tests in or after the option parsing loop.

The getopts utility does not do this because options can have more complex relationships such thatas some options conflicting, some options requiring the precense of other options etc. This is left to to the script author to sort out with their own logic.

The getopts utility does not know about mandatory options, only about what options are allowed. If you want to enforce mandatory options, you would have to do so with your own tests in or after the option parsing loop.

The getopts utility does not do this because options can have more complex relationships such that some options conflicting, some options requiring the precense of other options etc. This is left to to the script author to sort out with their own logic.

The getopts utility does not know about mandatory options, only about what options are allowed (and what options out of these should take an option argument). If you want to enforce mandatory options, you would have to do so with your own tests in or after the option parsing loop.

The getopts utility does not do this because options can have more complex relationships such as some options conflicting, some options requiring the precense of other options etc. This is left to to the script author to sort out with their own logic.

added 6 characters in body
Source Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k

The getopts utility does not know about mandatory options, only about what options are allowed. If you want to enforce mandatory options, you would have to do so with your own tests in or after the option parsing loop.

The getopts utility does not do this because options can have more complex relationships such that some options conflictconflicting, some options requiring the precense of other options etc. This is left to to the script author to sort out with their own logic.

The getopts utility does not know about mandatory options, only about what options are allowed. If you want to enforce mandatory options, you would have to do so with your own tests after the option parsing loop.

The getopts utility does not do this because options can have more complex relationships such that some options conflict etc. This is left to to the script author to sort out with their own logic.

The getopts utility does not know about mandatory options, only about what options are allowed. If you want to enforce mandatory options, you would have to do so with your own tests in or after the option parsing loop.

The getopts utility does not do this because options can have more complex relationships such that some options conflicting, some options requiring the precense of other options etc. This is left to to the script author to sort out with their own logic.

Source Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k
Loading