| 27 | } |
| 28 | |
| 29 | func (v *versionCmd) version() { |
| 30 | toolchainPath, _ := filepath.Abs("toolchain_file.cmake") |
| 31 | toolchainPath = color.Sprintf(color.Important, "%s", toolchainPath) |
| 32 | |
| 33 | content := fmt.Sprintf("Welcome to Celer (%s)\n"+ |
| 34 | "--------------------------------------------\n"+ |
| 35 | "This is a lightweight pkg-manager for C/C++.\n\n"+ |
| 36 | "How to apply it in your cmake project: \n"+ |
| 37 | "option1: %s\n"+ |
| 38 | "option2: %s\n\n", |
| 39 | v.celer.Version(), |
| 40 | color.Sprintf(color.Title, "set(CMAKE_TOOLCHAIN_FILE \"%s\")", toolchainPath), |
| 41 | color.Sprintf(color.Title, "cmake .. -DCMAKE_TOOLCHAIN_FILE=\"%s\"", toolchainPath), |
| 42 | ) |
| 43 | fmt.Print(content) |
| 44 | } |