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

Clean up command line arguments processing #1160

Merged
merged 8 commits into from May 28, 2018

Conversation

Projects
None yet
3 participants
@jean-m-cyr
Collaborator

jean-m-cyr commented May 26, 2018

No description provided.

jean-m-cyr added some commits May 26, 2018

Parse command line using CLI11
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 from Parse command line to Clean up command line arguments processing May 27, 2018

@AndreaLanfranchi

This comment has been minimized.

Show comment
Hide comment
@AndreaLanfranchi

AndreaLanfranchi May 27, 2018

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 ...

Collaborator

AndreaLanfranchi commented May 27, 2018

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

This comment has been minimized.

Show comment
Hide comment
@jean-m-cyr

jean-m-cyr May 27, 2018

Collaborator

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

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

Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@AndreaLanfranchi

AndreaLanfranchi May 27, 2018

Collaborator

Sorry ... I was totally missing that.

Collaborator

AndreaLanfranchi commented May 27, 2018

Sorry ... I was totally missing that.

@jean-m-cyr

This comment has been minimized.

Show comment
Hide comment
@jean-m-cyr

jean-m-cyr May 27, 2018

Collaborator

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.

Collaborator

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

This comment has been minimized.

Show comment
Hide comment
@AndreaLanfranchi

AndreaLanfranchi May 27, 2018

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

Collaborator

AndreaLanfranchi commented May 27, 2018

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

This comment has been minimized.

Show comment
Hide comment
@jean-m-cyr

jean-m-cyr May 27, 2018

Collaborator

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?

Collaborator

jean-m-cyr commented May 27, 2018

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

This comment has been minimized.

Show comment
Hide comment
@AndreaLanfranchi

AndreaLanfranchi May 27, 2018

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.

Collaborator

AndreaLanfranchi commented May 27, 2018

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

This comment has been minimized.

Show comment
Hide comment
@jean-m-cyr

jean-m-cyr May 27, 2018

Collaborator

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.

Collaborator

jean-m-cyr commented May 27, 2018

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

This comment has been minimized.

Show comment
Hide comment
@chfast

chfast May 27, 2018

Contributor

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.

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.

Constrain --cuda-parallel-hash parameter to powers of 2
Fix broken simulation and benchmark option processing
@AndreaLanfranchi

This comment has been minimized.

Show comment
Hide comment
@AndreaLanfranchi

AndreaLanfranchi May 28, 2018

Collaborator

@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
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
@AndreaLanfranchi

Good for me

@jean-m-cyr jean-m-cyr merged commit 69acd1a into master May 28, 2018

3 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@jean-m-cyr jean-m-cyr deleted the cli branch May 28, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment