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

spidev: process arguments for raw command #2973

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rminnich
Copy link
Member

for the raw command, for each arg, dump arg size bytes to stdout.

Ryan, feel free to tell me this should be done differently/better :-)

I just did not want to lose these changes.

for the raw command, for each arg, dump arg size bytes to
stdout.

Signed-off-by: Ronald G. Minnich <rminnich@gmail.com>
@rminnich rminnich added the Awaiting reviewer Waiting for a reviewer. label Apr 25, 2024
@rminnich rminnich requested a review from rjoleary April 25, 2024 16:52
if fs.NArg() != 1 {
return fmt.Errorf("%w: %s <raw|sfdp|id>", errCommand, fs.FlagUsages())
if fs.NArg() == 0 {
return fmt.Errorf("%w: %s <raw [bytes]...|sfdp|id>", errCommand, fs.FlagUsages())
Copy link
Member

Choose a reason for hiding this comment

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

would it make sense to update lin 68 to be consistent with this new format ?

line 68: return fmt.Errorf("%w:<raw|sfdp|id>", errCommand)

Copy link
Member

Choose a reason for hiding this comment

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

ah, line 80 looks like matching 68, but mis-match with here. does it make sense to use one form to be consistent ?

@10000TB
Copy link
Member

10000TB commented May 15, 2024

BTW, not related to this change, but pflag seems to print out an error on spidev --help , which looks weird

xuehaohu@worldpeace:~$ spidev --help
Usage of spidev:
  -D, --device string   spidev device (default "/dev/spidev0.0")
  -s, --speed uint32    max speed in Hz (default 500000)
2024/05/15 13:04:58 Error: pflag: help requested
xuehaohu@worldpeace:~$

@10000TB 10000TB added Awaiting author Waiting for new changes or feedback for author. and removed Awaiting reviewer Waiting for a reviewer. labels May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting author Waiting for new changes or feedback for author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants