Skip to content

Commit 66589ad

Browse files
committed
docs(architecture): clarify autocompletion instructions for Bash, Zsh, and PowerShell on Linux, MacOS, and Windows
1 parent 4fa7ffb commit 66589ad

File tree

3 files changed

+12
-27
lines changed

3 files changed

+12
-27
lines changed

ARCHITECTURE.md

+10-26
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ activate-global-python-argcomplete
490490

491491
### Fine granular python argcomplete
492492

493-
For Bash autocompletion, add this to your `~/.bashrc`:
493+
For Bash (linux, MacOS) autocompletion, add this to your `~/.bashrc`:
494494

495495
```bash
496496
eval "$(register-python-argcomplete ardupilot_methodic_configurator)"
@@ -500,7 +500,7 @@ eval "$(register-python-argcomplete param_pid_adjustment_update)"
500500
eval "$(register-python-argcomplete mavftp)"
501501
```
502502

503-
For Zsh autocompletion, add these lines to your `~/.zshrc`:
503+
For Zsh (linux, MacOS) autocompletion, add these lines to your `~/.zshrc`:
504504

505505
```zsh
506506
autoload -U bashcompinit
@@ -512,32 +512,16 @@ eval "$(register-python-argcomplete param_pid_adjustment_update)"
512512
eval "$(register-python-argcomplete mavftp)"
513513
```
514514

515-
For PowerShell autocompletion, run this command in PowerShell:
515+
For PowerShell (MS Windows) autocompletion, run this command in PowerShell:
516516

517517
```powershell
518-
$scripts = @(
519-
'ardupilot_methodic_configurator',
520-
'extract_param_defaults',
521-
'annotate_params',
522-
'param_pid_adjustment_update',
523-
'mavftp'
524-
)
525-
foreach ($script in $scripts) {
526-
Register-ArgumentCompleter -Native -CommandName $script -ScriptBlock {
527-
param($wordToComplete, $commandAst, $cursorPosition)
528-
$command = $script
529-
$env:COMP_LINE = $commandAst.ToString()
530-
$env:COMP_POINT = $cursorPosition
531-
$env:_ARGCOMPLETE = "1"
532-
$env:_ARGCOMPLETE_COMP_WORDBREAKS = " `"`'><=;|&(:"
533-
$env:COMP_WORDS = $commandAst.ToString()
534-
$env:COMP_CWORD = $cursorPosition
535-
536-
(& python -m argcomplete.completers $command) | ForEach-Object {
537-
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
538-
}
539-
}
540-
}
518+
notepad $PROFILE
519+
```
520+
521+
And add this line to the file:
522+
523+
```powershell
524+
Import-Module "C:\Program Files (x86)\ardupilot_methodic_configurator\ardupilot_methodic_configurator_command_line_completion.psm1"
541525
```
542526

543527
<!-- Gurubase Widget -->

SECURITY.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ We aim to resolve vulnerabilities promptly and appreciate your cooperation in ma
2323

2424
We encourage responsible disclosure of security vulnerabilities.
2525
Please provide detailed information about the vulnerability, including steps to reproduce it, affected components, and potential impact.
26-
This will help us to effectively address the issue.
26+
This will help us to effectively address the issue.

windows/ardupilot_methodic_configurator.iss

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ Source: "..\ardupilot_methodic_configurator\vehicle_components_schema.json"; Des
9191
Source: "..\LICENSES\*.*"; DestDir: "{app}\LICENSES"; Flags: ignoreversion
9292
Source: "..\credits\*.*"; DestDir: "{app}\credits"; Flags: ignoreversion
9393
Source: "..\ardupilot_methodic_configurator\locale\*.mo"; DestDir: "{app}\_internal\ardupilot_methodic_configurator\locale"; Flags: ignoreversion recursesubdirs createallsubdirs
94+
Source: "..\ardupilot_methodic_configurator_command_line_completion.psm1"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
9495

9596
[Dirs]
9697
Name: "{userappdata}\.ardupilot_methodic_configurator\vehicles"; Flags: uninsneveruninstall

0 commit comments

Comments
 (0)