Skip to content
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

Merged
merged 7 commits into from
Dec 19, 2017
Merged

Command line option names #733

merged 7 commits into from
Dec 19, 2017

Conversation

emmanuel-deloget
Copy link
Contributor

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

@@ -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' },
Copy link
Contributor

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

Copy link
Contributor

@martinezjavier martinezjavier left a 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!

@emmanuel-deloget
Copy link
Contributor Author

@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]>
@emmanuel-deloget
Copy link
Contributor Author

For the record, the latest update is due to a spurious rebase; there is no change at all.

@williamcroberts williamcroberts merged commit d932ed6 into tpm2-software:master Dec 19, 2017
@emmanuel-deloget emmanuel-deloget deleted the cmdline-option-names branch December 20, 2017 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rationalize command line option long and short names
3 participants