I am writing some scripts in bash and other languages and I am always confused (this might be due to different syntax of various tools I have used in the past): what is the most generally accepted syntax for optional command line parameters?
Should I use --my-parameter 10
or -mypar10
or --my-parameter=10
or -mypar=10
or something else?
getopts
, andgetopt
(on some platforms) to handle long options. See this over on StackOverflow – Chris Davies Sep 07 '20 at 07:16