(args []string)
| 48 | } |
| 49 | |
| 50 | func determineSymlinkLocation(args []string) (string, error) { |
| 51 | var symlinkToCompletionFile string |
| 52 | var err error |
| 53 | |
| 54 | //optionally override the symlink location from command line |
| 55 | if len(args) > 0 { |
| 56 | symlinkToCompletionFile, err = expandHomeDirectory(args[0]) |
| 57 | if err != nil { |
| 58 | return "", err |
| 59 | } |
| 60 | } else { |
| 61 | symlinkToCompletionFile = locateProbableCompletionFileLocation() |
| 62 | } |
| 63 | return symlinkToCompletionFile, nil |
| 64 | } |
| 65 | |
| 66 | func createSymlink(completionFilePath string, symlinkToCompletionFile string) error { |
| 67 | err := os.Symlink(completionFilePath, symlinkToCompletionFile) |
no test coverage detected