![]() And once you have documented your code, and it is clear what new meaning you have given to these words by giving examples, those names and meanings might just stick if there are enough people who pick them up from your code.Exiftool Application Documentation exiftool Application DocumentationĮxiftool - Read and write meta information in files SYNOPSIS ReadingĮxiftool FILE. On a broader note, since every programmer has the option to try and look up some standard way of doing things and naming things, but can also reinvent the wheel without much extra cost, naming is never going to be consistent. "Flags" are, in my experience, the same as options, but usually do not take arguments themselves and essentially represent boolean on-off switches. An option can itself take an argument (e.g., -w80 and -color=always), or occasionally multiple arguments. Options are often preceded by a single ( -) or double ( -, long-option) dash, but there are well-known commands that do not require or enforce dash usage for options (e.g., tar, ps, and dd). But there is precedent for "options" that are not actually optional: for example, the argparse manual states that one can create a "required option" (although it also says that this is "generally considered bad form"). The getopt C library is one use of this term. ![]() ![]() The term "option" is derived from "optional", which implies they can be left out. ![]() However, I have also seen them being called "parameters". The argparse Python library also helps to enforce the term "argument". In the case of "argument"/"option"/"flag", canonical manuals and tutorials for programming languages have helped to enforce usage, as has the terms used in common libraries.įor instance, the things you put on the command line after a command are often called "arguments" to the command, by analogy with arguments to a function call, and this is probably partly because they are called "arguments" in the C manual (hence argc and argv). There are different ways that consensus definitions for terms can come about in programming. This happens with much terminology: after 30+ years of using the word "directory", I now have to deal with people using the word "folder" who have been confused by Microsoft's new-speak. There are no consistent definitions of the terms "option", "argument", and "flag", and there is no central authority within the software development world that could enforce their usage. Arguments appear sufficiently different to maintain them as such. I could see myself combining flags and options (some options may have a dozen possible values, but Booleans only have two). arguments tell commands what object to operate on.options help define how a command should behave.However, I'm already seeing a pattern forming: I write and edit technical documentation, primarily in DocBook XML, and I'm looking for an explanation of the difference, which is consistent and accurate as possible. What's to stop me from calling that a "read option"? This has the "read flag" set for the owner, but that's all. I can't think of an example that might say "this is a flag" except perhaps when looking at dir listing: -r. Sudo -u username ( -u = option, username = arg)Ĭhmod 664 my-dir ( 664 = option, my-dir = arg) ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |