summaryrefslogtreecommitdiff
path: root/fetch
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-05-17 03:08:54 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-05-17 03:08:54 -0500
commit6eba782291a999e4577bc8d3386f0dcb6945e6a4 (patch)
tree1c3d48203bc6d335df0b284c5a6f692c3fcbc5eb /fetch
parenta6b3b0f6cbaeb90995f5aa14eca7e27d9ff218e2 (diff)
downloadhorizon-6eba782291a999e4577bc8d3386f0dcb6945e6a4.tar.gz
horizon-6eba782291a999e4577bc8d3386f0dcb6945e6a4.tar.bz2
horizon-6eba782291a999e4577bc8d3386f0dcb6945e6a4.tar.xz
horizon-6eba782291a999e4577bc8d3386f0dcb6945e6a4.zip
all: Add --version and --help support and unify output formats
Diffstat (limited to 'fetch')
-rw-r--r--fetch/fetch.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/fetch/fetch.cc b/fetch/fetch.cc
index b1a9f56..25e13bc 100644
--- a/fetch/fetch.cc
+++ b/fetch/fetch.cc
@@ -173,9 +173,12 @@ int main(int argc, char *argv[]) {
bold_if_pretty(std::cout);
std::cout << "HorizonScript Locator version " << VERSTR;
reset_if_pretty(std::cout);
- std::cout << std::endl;
- std::cout << "Copyright (c) 2019 Adélie Linux and contributors. AGPL-3.0 license." << std::endl;
- std::cout << std::endl;
+ std::cout << std::endl
+ << "Copyright (c) 2019-2020 Adélie Linux and contributors."
+ << std::endl
+ << "This software is licensed to you under the terms of the "
+ << std::endl << "AGPL 3.0 license, unless otherwise noted."
+ << std::endl << std::endl;
if(argc == 1) {
if(access(IFILE_PATH, F_OK) == 0) {
@@ -195,6 +198,10 @@ int main(int argc, char *argv[]) {
}
std::string path(argv[1]);
+ if(path == "--version") {
+ /* Banner printed above is our version statement. */
+ return EXIT_SUCCESS;
+ }
if(path[0] == '/') {
return process_local(path);