-
Notifications
You must be signed in to change notification settings - Fork 196
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
introduce SCPI_HelpQ with descriptions #135
Open
MisterHW
wants to merge
24
commits into
j123b567:master
Choose a base branch
from
MisterHW:scpi_helpq_enhancement
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
28b17f7
output block data with delimiter
MisterHW 8ed2623
fix typos
MisterHW bc4f1d5
introduce SCPI_HelpQ
MisterHW 315f20d
introduce help search
MisterHW 159fe83
drop C++20 keyword
MisterHW d099d9a
rename to USE_HELP_FILTER
MisterHW aa660db
fix expression
MisterHW 1460793
add full command descriptions to examples common def, set desc. defau…
MisterHW 7d0c83d
clean-up
MisterHW c394eb9
propagate MODE to Makefile for cross-compiling
MisterHW 1e1b594
provide more elaborate description depending on USE_HELP_FILTER
MisterHW f7c4cc4
Merge branch 'j123b567:master' into scpi_helpq_enhancement
MisterHW b3668be
Merge branch 'j123b567:master' into scpi_helpq_enhancement
MisterHW 36ddafe
strncasestr, strncasestrn_s, pp_xstr clean-up and formatting
MisterHW 9c66dcd
fix C89 issue (FALSE, for syntax)
MisterHW 0e7c828
remove strcasestr
MisterHW 5dfac2b
strncasecmp -> SCPIDEFINE_strncasecmp
MisterHW 5153e03
C style comments
MisterHW 8aa90a7
split off HELP? into help.h/.c
MisterHW 31a3e44
add help.c, help.h to Makefile
MisterHW d8a5d24
redo delete SCPI_HelpQ
MisterHW 63f5e88
Revert "propagate MODE to Makefile for cross-compiling"
MisterHW d803ffe
simply SCPI_CMD_LIST_END definition
MisterHW a44b9aa
add missing ,
MisterHW File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Can you please provide alternative definition files for this functionality?
It is a generally useful but unusual extension. I would like to keep examples simple. Users can decide on their own if they would like to use help command or not and it is generally not needed. It will find its way, but I would like to keep the first impression simple.
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.
Alternatively, somehow divide the existing source (it is just an example anyway) so one part of the commands has help and the other does not so it is clear, that it is not mandatory to use and define help and tag.
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.
scpi-def.c
andscpi-def.cpp
are essentially identical.scpi-def.c
could be stripped down to illustrate what a version with no help and no command tags could look like. One could additionally introducewhich would help being explicit about the generalized structure. With
scpi-def
being incommon
, offering definitions for all possible cases seems a bit excessive to me.Retrospective Context:
Keep in mind that prior to this PR, the default was
and setting it to 0 would cause a type mismatch, as in
scpi-def.c/.cpp
there were extra (unconditional), 0
in thescpi_commands[]
items.The documentation on
HELP?
might be the best place to elaborate on way to further strip down the definition and explain the implications. This was warrented through the existence ofUSE_COMMAND_TAGS
, and in my opinion is underscored yet again through the introduction ofUSE_COMMAND_DESCRIPTIONS
.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.
Yes,
scpi-def.cpp
is identical to thescpi-def.c
but all C specific features are removed so it can be compiled by the C++ compiler. Because this is C library, C++ file is just an example without real usage here.Initially, examples were more about the communication interface and the command interface was the same. In the current perspective, there could be more standalone examples promoting separate features of the library, like enabling/disabling TAGs, and more importantly, introducing
HELP?
command.Maybe, there can be a new example based on e.g.
test-interactive
to show, howHELP?
command works and how to define all strings. It can have a completely different structure and its own commands definition.