in reply to Perl: Extracting the value from --rsync-path=PROGRAM key/value pair

rsync uses popt(3) rather than getopt(3). rsync explains why at https://github.com/WayneD/rsync/tree/master/popt

1) popt is fully reentrant 2) popt can parse arbitrary argv[] style arrays while getopt(2) makes this quite difficult 3) popt allows users to alias command line arguments 4) popt provides convience functions for parsing strings into argv[] style arrays

popt is a library from Redhat that's only common on Linux. If you just want to do it like rsync does, getopt is pretty close.

  • Comment on Re: Perl: Extracting the value from --rsync-path=PROGRAM key/value pair
  • Download Code