Skip to content

Commit ab28903

Browse files
committed
Added --build-path as alias for --input-dir in upload and debug commands
1 parent 26fe3be commit ab28903

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

internal/cli/debug/debug.go

+4
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ func NewCommand(srv rpc.ArduinoCoreServiceServer) *cobra.Command {
5353
Long: i18n.Tr("Debug Arduino sketches. (this command opens an interactive gdb session)"),
5454
Example: " " + os.Args[0] + " debug -b arduino:samd:mkr1000 -P atmel_ice /home/user/Arduino/MySketch",
5555
Args: cobra.MaximumNArgs(1),
56+
PreRun: func(cmd *cobra.Command, args []string) {
57+
arguments.CheckFlagsConflicts(cmd, "input-dir", "build-path")
58+
},
5659
Run: func(cmd *cobra.Command, args []string) {
5760
runDebugCommand(cmd.Context(), srv, args, &portArgs, &fqbnArg, interpreter, importDir, &programmer, printInfo, &profileArg)
5861
},
@@ -64,6 +67,7 @@ func NewCommand(srv rpc.ArduinoCoreServiceServer) *cobra.Command {
6467
programmer.AddToCommand(debugCommand, srv)
6568
profileArg.AddToCommand(debugCommand, srv)
6669
debugCommand.Flags().StringVar(&interpreter, "interpreter", "console", i18n.Tr("Debug interpreter e.g.: %s", "console, mi, mi1, mi2, mi3"))
70+
debugCommand.Flags().StringVarP(&importDir, "build-path", "", "", i18n.Tr("Directory containing binaries for debug."))
6771
debugCommand.Flags().StringVarP(&importDir, "input-dir", "", "", i18n.Tr("Directory containing binaries for debug."))
6872
debugCommand.Flags().BoolVarP(&printInfo, "info", "I", false, i18n.Tr("Show metadata about the debug session instead of starting the debugger."))
6973

internal/cli/upload/upload.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func NewCommand(srv rpc.ArduinoCoreServiceServer) *cobra.Command {
6060
" " + os.Args[0] + " upload -p 192.168.10.1 -b arduino:avr:uno --upload-field password=abc",
6161
Args: cobra.MaximumNArgs(1),
6262
PreRun: func(cmd *cobra.Command, args []string) {
63-
arguments.CheckFlagsConflicts(cmd, "input-file", "input-dir")
63+
arguments.CheckFlagsConflicts(cmd, "input-file", "input-dir", "build-path")
6464
},
6565
Run: func(cmd *cobra.Command, args []string) {
6666
runUploadCommand(cmd.Context(), srv, args, uploadFields)
@@ -70,6 +70,7 @@ func NewCommand(srv rpc.ArduinoCoreServiceServer) *cobra.Command {
7070
fqbnArg.AddToCommand(uploadCommand, srv)
7171
portArgs.AddToCommand(uploadCommand, srv)
7272
profileArg.AddToCommand(uploadCommand, srv)
73+
uploadCommand.Flags().StringVarP(&importDir, "build-path", "", "", i18n.Tr("Directory containing binaries to upload."))
7374
uploadCommand.Flags().StringVarP(&importDir, "input-dir", "", "", i18n.Tr("Directory containing binaries to upload."))
7475
uploadCommand.Flags().StringVarP(&importFile, "input-file", "i", "", i18n.Tr("Binary file to upload."))
7576
uploadCommand.Flags().BoolVarP(&verify, "verify", "t", false, i18n.Tr("Verify uploaded binary after the upload."))

0 commit comments

Comments
 (0)