Skip to content

Commit 3486d94

Browse files
committed
add completion for lib examples
1 parent 6d560b2 commit 3486d94

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

cli/lib/examples.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ func initExamplesCommand() *cobra.Command {
4242
Example: " " + os.Args[0] + " lib examples Wire",
4343
Args: cobra.MaximumNArgs(1),
4444
Run: runExamplesCommand,
45+
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
46+
return arguments.GetUninstallableLibs(toComplete), cobra.ShellCompDirectiveDefault
47+
},
4548
}
4649
examplesCommand.Flags().StringVarP(&examplesFlags.fqbn, "fqbn", "b", "", tr("Show libraries for the specified board FQBN."))
4750
examplesCommand.RegisterFlagCompletionFunc("fqbn", func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {

i18n/data/en.po

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -774,7 +774,7 @@ msgstr "Error getting current directory for compilation database: %s"
774774
msgid "Error getting information for library %s"
775775
msgstr "Error getting information for library %s"
776776

777-
#: cli/lib/examples.go:73
777+
#: cli/lib/examples.go:76
778778
msgid "Error getting libraries info: %v"
779779
msgstr "Error getting libraries info: %v"
780780

@@ -977,7 +977,7 @@ msgstr "Error: invalid source code overrides data file: %v"
977977
msgid "Event"
978978
msgstr "Event"
979979

980-
#: cli/lib/examples.go:122
980+
#: cli/lib/examples.go:125
981981
msgid "Examples for library %s"
982982
msgstr "Examples for library %s"
983983

@@ -1481,7 +1481,7 @@ msgstr "No boards found."
14811481
msgid "No colon in first line of depfile"
14821482
msgstr "No colon in first line of depfile"
14831483

1484-
#: cli/lib/examples.go:107
1484+
#: cli/lib/examples.go:110
14851485
msgid "No libraries found."
14861486
msgstr "No libraries found."
14871487

@@ -1848,7 +1848,7 @@ msgstr "Show full board details"
18481848
msgid "Show information about a board, in particular if the board has options to be specified in the FQBN."
18491849
msgstr "Show information about a board, in particular if the board has options to be specified in the FQBN."
18501850

1851-
#: cli/lib/examples.go:46
1851+
#: cli/lib/examples.go:49
18521852
#: cli/lib/list.go:49
18531853
msgid "Show libraries for the specified board FQBN."
18541854
msgstr "Show libraries for the specified board FQBN."

0 commit comments

Comments
 (0)