-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
3 changed files
with
112 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
Copyright © 2021 Remi Ferrand | ||
Contributor(s): Remi Ferrand <riton.github_at_gmail(dot)com>, 2021 | ||
This software is a computer program whose purpose is to interact with | ||
the ENSAP API (ensap.gouv.fr). | ||
This software is governed by the CeCILL-B license under French law and | ||
abiding by the rules of distribution of free software. You can use, | ||
modify and/ or redistribute the software under the terms of the CeCILL-B | ||
license as circulated by CEA, CNRS and INRIA at the following URL | ||
"http://www.cecill.info". | ||
As a counterpart to the access to the source code and rights to copy, | ||
modify and redistribute granted by the license, users are provided only | ||
with a limited warranty and the software's author, the holder of the | ||
economic rights, and the successive licensors have only limited | ||
liability. | ||
In this respect, the user's attention is drawn to the risks associated | ||
with loading, using, modifying and/or developing or reproducing the | ||
software by the user in light of its specific status of free software, | ||
that may mean that it is complicated to manipulate, and that also | ||
therefore means that it is reserved for developers and experienced | ||
professionals having in-depth computer knowledge. Users are therefore | ||
encouraged to load and test the software's suitability as regards their | ||
requirements in conditions enabling the security of their systems and/or | ||
data to be ensured and, more generally, to use and operate it in the | ||
same conditions as regards security. | ||
The fact that you are presently reading this means that you have had | ||
knowledge of the CeCILL-B license and that you accept its terms. | ||
*/ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/riton/ensap-cli/version" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
// versionCmd represents the version command | ||
var versionCmd = &cobra.Command{ | ||
Use: "version", | ||
Short: "Display software version and exit", | ||
Run: func(cmd *cobra.Command, args []string) { | ||
verbosity, _ := cmd.Flags().GetCount("verbose") | ||
if verbosity == 0 { | ||
fmt.Printf("%s\n", version.Version) | ||
} else { | ||
fmt.Printf("%s (git %s, built on %s)\n", version.Version, version.Commit, version.BuildDate) | ||
} | ||
}, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(versionCmd) | ||
versionCmd.Flags().CountP("verbose", "v", "Increase verbosity") | ||
} |
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,43 @@ | ||
/* | ||
Copyright © 2021 Remi Ferrand | ||
Contributor(s): Remi Ferrand <riton.github_at_gmail(dot)com>, 2021 | ||
This software is a computer program whose purpose is to interact with | ||
the ENSAP API (ensap.gouv.fr). | ||
This software is governed by the CeCILL-B license under French law and | ||
abiding by the rules of distribution of free software. You can use, | ||
modify and/ or redistribute the software under the terms of the CeCILL-B | ||
license as circulated by CEA, CNRS and INRIA at the following URL | ||
"http://www.cecill.info". | ||
As a counterpart to the access to the source code and rights to copy, | ||
modify and redistribute granted by the license, users are provided only | ||
with a limited warranty and the software's author, the holder of the | ||
economic rights, and the successive licensors have only limited | ||
liability. | ||
In this respect, the user's attention is drawn to the risks associated | ||
with loading, using, modifying and/or developing or reproducing the | ||
software by the user in light of its specific status of free software, | ||
that may mean that it is complicated to manipulate, and that also | ||
therefore means that it is reserved for developers and experienced | ||
professionals having in-depth computer knowledge. Users are therefore | ||
encouraged to load and test the software's suitability as regards their | ||
requirements in conditions enabling the security of their systems and/or | ||
data to be ensured and, more generally, to use and operate it in the | ||
same conditions as regards security. | ||
The fact that you are presently reading this means that you have had | ||
knowledge of the CeCILL-B license and that you accept its terms. | ||
*/ | ||
package version | ||
|
||
// Those are fed by the goreleaser tool | ||
var ( | ||
Version = "dev" | ||
Commit = "none" | ||
BuildDate = "none" | ||
) |