mirror of
https://github.com/RoganDawes/P4wnP1_aloa.git
synced 2025-03-17 21:31:56 +01:00
CLI: add bash completion on start
This commit is contained in:
parent
5a08364ad3
commit
d9020808a9
@ -22,7 +22,17 @@ from the command line. The tool relies on RPC so it could be used
|
||||
remotely.`,
|
||||
}
|
||||
|
||||
func GenBashComplete() {
|
||||
target := "/etc/bash_completion.d/p4wnp1.sh"
|
||||
if _, err := os.Stat(target); os.IsNotExist(err) {
|
||||
rootCmd.GenBashCompletionFile(target)
|
||||
}
|
||||
}
|
||||
|
||||
func Execute() {
|
||||
// ToDo: this should be changed to a dedicated command which is sourced in in .bashrc to assure updates on start of bash
|
||||
GenBashComplete()
|
||||
|
||||
if err := rootCmd.Execute(); err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user