-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c2dfefa
commit a2b1538
Showing
4 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/************************************************************************* | ||
| tarman | | ||
| Copyright (C) 2024 Alessandro Salerno | | ||
| | | ||
| This program is free software: you can redistribute it and/or modify | | ||
| it under the terms of the GNU General Public License as published by | | ||
| the Free Software Foundation, either version 3 of the License, or | | ||
| (at your option) any later version. | | ||
| | | ||
| This program is distributed in the hope that it will be useful, | | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | | ||
| GNU General Public License for more details. | | ||
| | | ||
| You should have received a copy of the GNU General Public License | | ||
| along with this program. If not, see <https://www.gnu.org/licenses/>. | | ||
*************************************************************************/ | ||
|
||
#include <stdbool.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
#include "cli/directives/types.h" | ||
#include "cli/output.h" | ||
|
||
#define STR_HELPER(x) #x | ||
#define STR(x) STR_HELPER(x) | ||
|
||
#ifndef EXT_TARMAN_BUILD | ||
#define EXT_TARMAN_BUILD "unknown" | ||
#endif | ||
|
||
#ifndef EXT_TARMAN_OS | ||
#define EXT_TARMAN_OS "unknown" | ||
#endif | ||
|
||
#ifndef EXT_TARMAN_COMPILER | ||
#if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__) | ||
#define EXT_TARMAN_COMPILER \ | ||
"gcc " STR(__GNUC__) "." STR(__GNUC_MINOR__) "." STR(__GNUC_PATCHLEVEL__) | ||
#elif defined(_clang_version__) | ||
#define EXT_TARMAN_COMPILER "clang " __clang_version__ | ||
#elif defined(__llvm__) | ||
#define EXT_TARMAN_COMPILER "generic llvm" | ||
#else | ||
#define EXT_TARMAN_COMPILER "unknown" | ||
#endif | ||
#endif // EXT_TARMAN_COMPILER | ||
|
||
int cli_cmd_version(cli_info_t info) { | ||
(void)info; | ||
|
||
puts("tarman version " EXT_TARMAN_BUILD); | ||
puts("target: " EXT_TARMAN_OS); | ||
puts("compiled with: " EXT_TARMAN_COMPILER); | ||
|
||
return EXIT_SUCCESS; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters