Skip to content

Adding optional argument parsing to the tool#13

Merged
ishaansehgal99 merged 1 commit into
mainfrom
dev/t-isehgal/add-optional-args
Aug 8, 2022
Merged

Adding optional argument parsing to the tool#13
ishaansehgal99 merged 1 commit into
mainfrom
dev/t-isehgal/add-optional-args

Conversation

@ishaansehgal99

@ishaansehgal99 ishaansehgal99 commented Jul 27, 2022

Copy link
Copy Markdown
Contributor

Simple argument command line parsing.

We need this because we have three potential arguments that can be passed into the program

  1. -d destination directory for storing hibernation setup tool exe, and hibernation setup tool service
  2. -w when, when running hooks -w used to specify "pre" or "post" hook
  3. -a action, specifies we are running the "hibernate" action, in future if we want action like "suspend" or "hybrid" this parameter can be changed

Currently command line parsing is done by arbitrarily taking the next two arguments in argv, assuming their order. Now with three arguments we use more specific command line parsing, to ensure parameters are passed and get executed on as expected.

@dcui dcui left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks!

Comment thread hibernation-setup-tool.c
@ishaansehgal99 ishaansehgal99 merged commit 1d54ac4 into main Aug 8, 2022
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.

3 participants