Skip to content

Commit 7fae6dc

Browse files
committed
Moved flash-firmware to flash firmware subcommand
1 parent ff2623d commit 7fae6dc

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

cli/firmware/firmware.go

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ func NewCommand() *cobra.Command {
3333
Example: " " + os.Args[0] + " firmware ...",
3434
}
3535

36+
firmwareCmd.AddCommand(NewFlashCommand())
3637
firmwareCmd.AddCommand(newListCommand())
3738
return firmwareCmd
3839
}

cli/flash_firmware/flash_firmware.go renamed to cli/firmware/flash.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
1919

20-
package flash_firmware
20+
package firmware
2121

2222
import (
2323
"bytes"
@@ -46,15 +46,15 @@ var (
4646
)
4747

4848
// NewCommand created a new `version` command
49-
func NewCommand() *cobra.Command {
49+
func NewFlashCommand() *cobra.Command {
5050
command := &cobra.Command{
51-
Use: "flash-firmware",
51+
Use: "flash",
5252
Short: "Flashes firmwares to board.",
5353
Long: "Flashes specified module firmware to board at specified address. Module name and version can be omitted to install latest version.",
5454
Example: "" +
55-
" " + os.Args[0] + " flash-firmware --fqbn arduino:samd:mkr1000 --address COM10 --module [email protected]\n" +
56-
" " + os.Args[0] + " flash-firmware -b arduino:samd:mkr1000 -a COM10 -m WINC15000\n" +
57-
" " + os.Args[0] + " flash-firmware -b arduino:samd:mkr1000 -a COM10\n",
55+
" " + os.Args[0] + " flash --fqbn arduino:samd:mkr1000 --address COM10 --module [email protected]\n" +
56+
" " + os.Args[0] + " flash -b arduino:samd:mkr1000 -a COM10 -m WINC15000\n" +
57+
" " + os.Args[0] + " flash -b arduino:samd:mkr1000 -a COM10\n",
5858
Args: cobra.NoArgs,
5959
Run: run,
6060
}
@@ -113,7 +113,7 @@ func run(cmd *cobra.Command, args []string) {
113113

114114
var firmware *firmwareindex.IndexFirmware
115115
if moduleVersion == "" {
116-
firmware = board.GetLatestFirmware()
116+
firmware = board.LatestFirmware
117117
} else {
118118
firmware = board.GetFirmware(moduleVersion)
119119
}

0 commit comments

Comments
 (0)