34
34
port arguments.Port
35
35
verbose bool
36
36
verify bool
37
- programmer string
37
+ programmer arguments. Programmer
38
38
dryRun bool
39
39
tr = i18n .Tr
40
40
)
@@ -52,12 +52,9 @@ func NewCommand() *cobra.Command {
52
52
53
53
fqbn .AddToCommand (burnBootloaderCommand )
54
54
port .AddToCommand (burnBootloaderCommand )
55
+ programmer .AddToCommand (burnBootloaderCommand )
55
56
burnBootloaderCommand .Flags ().BoolVarP (& verify , "verify" , "t" , false , tr ("Verify uploaded binary after the upload." ))
56
57
burnBootloaderCommand .Flags ().BoolVarP (& verbose , "verbose" , "v" , false , tr ("Turns on verbose mode." ))
57
- burnBootloaderCommand .Flags ().StringVarP (& programmer , "programmer" , "P" , "" , tr ("Use the specified programmer to upload." ))
58
- burnBootloaderCommand .RegisterFlagCompletionFunc ("programmer" , func (cmd * cobra.Command , args []string , toComplete string ) ([]string , cobra.ShellCompDirective ) {
59
- return arguments .GetInstalledProgrammers (), cobra .ShellCompDirectiveDefault
60
- })
61
58
burnBootloaderCommand .Flags ().BoolVar (& dryRun , "dry-run" , false , tr ("Do not perform the actual upload, just log out actions" ))
62
59
burnBootloaderCommand .Flags ().MarkHidden ("dry-run" )
63
60
@@ -80,7 +77,7 @@ func run(command *cobra.Command, args []string) {
80
77
Port : discoveryPort .ToRPC (),
81
78
Verbose : verbose ,
82
79
Verify : verify ,
83
- Programmer : programmer ,
80
+ Programmer : programmer . String () ,
84
81
DryRun : dryRun ,
85
82
}, os .Stdout , os .Stderr ); err != nil {
86
83
feedback .Errorf (tr ("Error during Upload: %v" ), err )
0 commit comments