Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 633c177

Browse files
committed
[breaking] remove board details <fqbn> in favour of board details -b <fqbn>
1 parent c316b38 commit 633c177

File tree

2 files changed

+3
-32
lines changed

2 files changed

+3
-32
lines changed

‎cli/board/details.go‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,14 @@ func initDetailsCommand() *cobra.Command {
4444
Short: tr("Print details about a board."),
4545
Long: tr("Show information about a board, in particular if the board has options to be specified in the FQBN."),
4646
Example: " " + os.Args[0] + " board details -b arduino:avr:nano",
47-
Args: cobra.MaximumNArgs(1),
47+
Args: cobra.NoArgs,
4848
Run: runDetailsCommand,
4949
}
5050

5151
fqbn.AddToCommand(detailsCommand)
5252
detailsCommand.Flags().BoolVarP(&showFullDetails, "full", "f", false, tr("Show full board details"))
5353
detailsCommand.Flags().BoolVarP(&listProgrammers, "list-programmers", "", false, tr("Show list of available programmers"))
54-
// detailsCommand.MarkFlagRequired("fqbn") // enable once `board details <fqbn>` is removed
54+
detailsCommand.MarkFlagRequired("fqbn")
5555

5656
return detailsCommand
5757
}
@@ -61,11 +61,6 @@ func runDetailsCommand(cmd *cobra.Command, args []string) {
6161

6262
logrus.Info("Executing `arduino-cli board details`")
6363

64-
// remove once `board details <fqbn>` is removed
65-
if fqbn.String() == "" && len(args) > 0 {
66-
fqbn.Set(args[0])
67-
}
68-
6964
res, err := board.Details(context.Background(), &rpc.BoardDetailsRequest{
7065
Instance: inst,
7166
Fqbn: fqbn.String(),

‎test/test_board.py‎

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -502,37 +502,13 @@ def test_board_details(run_command):
502502
assert result["debugging_supported"] is True
503503

504504

505-
# old `arduino-cli board details` did not need -b <fqbn> flag to work
506-
def test_board_details_old(run_command):
507-
run_command(["core", "update-index"])
508-
# Download samd core pinned to 1.8.6
509-
run_command(["core", "install", "arduino:samd@1.8.6"])
510-
result = run_command(["board", "details", "arduino:samd:nano_33_iot", "--format", "json"])
511-
assert result.ok
512-
# Sort everything before compare
513-
result = json.loads(result.stdout)
514-
gold_board_details = json.loads(gold_board)
515-
516-
assert result["fqbn"] == gold_board_details["fqbn"]
517-
assert result["name"] == gold_board_details["name"]
518-
assert result["version"] == gold_board_details["version"]
519-
assert result["properties_id"] == gold_board_details["properties_id"]
520-
assert result["official"] == gold_board_details["official"]
521-
assert result["package"] == gold_board_details["package"]
522-
assert result["platform"] == gold_board_details["platform"]
523-
for usb_id in gold_board_details["identification_properties"]:
524-
assert usb_id in result["identification_properties"]
525-
for programmer in gold_board_details["programmers"]:
526-
assert programmer in result["programmers"]
527-
528-
529505
def test_board_details_no_flags(run_command):
530506
run_command(["core", "update-index"])
531507
# Download samd core pinned to 1.8.6
532508
run_command(["core", "install", "arduino:samd@1.8.6"])
533509
result = run_command(["board", "details"])
534510
assert not result.ok
535-
assert "Error getting board details: Invalid FQBN:" in result.stderr
511+
assert 'Error: required flag(s) "fqbn" not set' in result.stderr
536512
assert result.stdout == ""
537513

538514

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /