-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command line option names #733
Command line option names #733
Conversation
@@ -154,7 +154,7 @@ static bool on_args(int argc, char **argv) { | |||
bool tpm2_tool_onstart(tpm2_options **opts) { | |||
|
|||
static const struct option topts[] = { | |||
{ "--output", required_argument, NULL, 'o' }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow, this was pretty wrong! In order to use it someone would had to do:
$ tpm2_send ----output command.bin
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the fixes and cleanups, very much appreciated!
@martinezjavier that's what I thought :) |
When comparing command line switches that are specified to select an output file, most of the tools use option 'out-file' and only a few of them use option 'output' or other rarer names such as 'outfile'. In order to rationalize option naming a bit, we turn all these option names into 'out-file'. Fixes: #729 Signed-off-by: Emmanuel Deloget <[email protected]>
Most tools use the 'algorithm' command line switch, so rename the option name for the few that are using it's shorthand 'alg'. Fixes: #729 Signed-off-by: Emmanuel Deloget <[email protected]>
The passwd shorthand is used for a large part of all password-related option names. Fixes: #729 Signed-off-by: Emmanuel Deloget <[email protected]>
Makes more clear what 'msg' is. Fixes: #729 Signed-off-by: Emmanuel Deloget <[email protected]>
This fixes some typos and other small errors related to command line options. Fixes: #729 Signed-off-by: Emmanuel Deloget <[email protected]>
Make sure options are defined the same way in all tools in order to simplify further development. Signed-off-by: Emmanuel Deloget <[email protected]>
The command line option code was a bit difficult to read because of missing spaces, column offsets and so on. Strealine this to make it easier to grasp (and to parse when using a tool). Signed-off-by: Emmanuel Deloget <[email protected]>
For the record, the latest update is due to a spurious rebase; there is no change at all. |
This series is made of two blocks.
The first block, containing 5 commits, change some option names to go in the direction of more rationalization. It fixes #729 (or at least it fixes part of this issue).
The second block of 2 commits begins with a commit that changes all 1 and 0 in the options blocks by the corresponding required_argument or no_argument. The last commit goes one step beyond and re-align all the option definition blocks so that they become easier to read (and maybe easier to parse with various tools).
Best regards,
-- Emmanuel Deloget