Skip to content
This repository has been archived by the owner on Apr 24, 2022. It is now read-only.

Clean up command line arguments processing #1160

Merged
merged 8 commits into from
May 28, 2018
Merged

Clean up command line arguments processing #1160

merged 8 commits into from
May 28, 2018

Conversation

jean-m-cyr
Copy link
Contributor

No description provided.

This introduces some unavoidable incompatibility due to
CLI11 limitations.

CLI11 does not support multi-character options with single
dash. Previous options like -RH, -HWMON, and -SE can't be
implemented as is.

The replacement --hwmon options must specify a 0 or a 1.
it can no longer we specified alone, implying a 0.
@jean-m-cyr jean-m-cyr changed the title Parse command line Clean up command line arguments processing May 27, 2018
@AndreaLanfranchi
Copy link
Collaborator

Is it me missing something or we do loose some sanity checks over entered values ?
For example that --tstop must be ge than --tstart ...

@jean-m-cyr
Copy link
Contributor Author

jean-m-cyr commented May 27, 2018

@AndreaLanfranchi The check can only occur after the parse, but it is included below.

if (m_tstop && (m_tstop <= m_tstart))

@AndreaLanfranchi
Copy link
Collaborator

Sorry ... I was totally missing that.

@jean-m-cyr
Copy link
Contributor Author

jean-m-cyr commented May 27, 2018

This builds on @chfast's work creating the CLI11 hunter package, making it available for us to use.

There is very little left in main.cpp! Should I combine main.cpp and Mineraux.h into a single file. There are no other includes of Mineraux.

@AndreaLanfranchi
Copy link
Collaborator

Good idea.
Worth it to have 2 files with single name: a proper header and a proper code file. (one .h and one .cpp)
IMHO

@jean-m-cyr
Copy link
Contributor Author

I was thinking a single main.cpp file. MinerAux.h is only included by main.cpp so it is not the typical header file. It contains mostly executable code and no common (shared) variables. It is strictly for main.cpp's use, so why not just include it as part of main.cpp instead of #including it as a separate file?

@AndreaLanfranchi
Copy link
Collaborator

Mine was only a suggestion due to personal habit ... wether there is a class (MinerCLI is) I prefer to have definition into .h and executable code in .cpp
But it's only cosmetic and I reckon It might involve some additional lines to write definitions.

@jean-m-cyr
Copy link
Contributor Author

There is no consistency in that respect in Ethminer. Some seem to prefer .h only formulation with executable code inline, others as you say with separate header and executable components. I'll adapt to whatever style is currently in use.

@chfast
Copy link
Contributor

chfast commented May 27, 2018

There is very little left in main.cpp! Should I combine main.cpp and Mineraux.h into a single file. There are no other includes of Mineraux.

Definitely, move code from MinerAux to main.cpp. The MinerAux was shared between eth/main and ethminer/main long time ago.

Fix broken simulation and benchmark option processing
@AndreaLanfranchi
Copy link
Collaborator

AndreaLanfranchi commented May 28, 2018

@jean-m-cyr could you please add in help text the meanings for stratumx+tcp modes ?
Since we've dropped -SP argument we have also dropped the description and now people do not understand whether to use stratum / stratum1 / stratum2

stratum: official stratum spec: ethpool, ethermine, coinotron, mph, nanopool (default)
stratum1: eth-proxy compatible: dwarfpool, f2pool, nanopool (required for hashrate reporting to work with nanopool)
stratum2: EthereumStratum/1.0.0: nicehash

Copy link
Collaborator

@AndreaLanfranchi AndreaLanfranchi left a comment

Choose a reason for hiding this comment

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

Good for me

@jean-m-cyr jean-m-cyr merged commit 69acd1a into master May 28, 2018
@jean-m-cyr jean-m-cyr deleted the cli branch May 28, 2018 19:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants