Improve --version
This commit is contained in:
parent
4cc86c990f
commit
a4614b2c87
14
Makefile
14
Makefile
@ -1,6 +1,20 @@
|
||||
#
|
||||
# Makefile for usqlite
|
||||
#
|
||||
#
|
||||
# Copyright (C) 2020 /df <https://git.hpkg.tv/df/usqlite/>
|
||||
#
|
||||
# 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/>.
|
||||
|
||||
.PHONY: all clean opkg release
|
||||
|
||||
|
@ -19,7 +19,7 @@ Options:
|
||||
--column-separator=SEP results (default "|")
|
||||
-v, --verbose Log details to stderr
|
||||
-V, --version, Print program version, licensing and
|
||||
warranty details to stderr
|
||||
warranty details to stderr, and continue
|
||||
-- Subsequent parameters are not options
|
||||
-h, --help, -? Print this help to stderr and exit
|
||||
|
||||
|
Binary file not shown.
32
usqlite.c
32
usqlite.c
@ -1,3 +1,22 @@
|
||||
/* usqlite - minimal SQLite exec wrapper
|
||||
*
|
||||
* Copyright (C) 2020 /df <https://git.hpkg.tv/df/usqlite/>
|
||||
*
|
||||
* 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 (the file LICENSE in the source directory). If not, see
|
||||
* <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
/* printf, scanf, stdin, stderr */
|
||||
#include <stdio.h>
|
||||
/* malloc, free */
|
||||
@ -366,6 +385,15 @@ static void usage(const char* progname) {
|
||||
fprintf( stderr, "Usage: %s [OPTIONS] [\"SQL command;\" ...] [< SQL_script]\n", progname);
|
||||
}
|
||||
|
||||
static void gpl(void) {
|
||||
fprintf( stderr, "Copyright (C) 2020 /df <https://git.hpkg.tv/df/usqlite/>\n"
|
||||
"\nThis program comes with ABSOLUTELY NO WARRANTY.\n"
|
||||
"This is free software, and you are welcome to redistribute it under the\n"
|
||||
"terms of the GNU General Public License as published by the Free Software\n"
|
||||
"Foundation, either version 3 of the License, or (at your option) any later\n"
|
||||
"version: see <https://www.gnu.org/licenses/>.\n\n" );
|
||||
}
|
||||
|
||||
static void help(const char* progname) {
|
||||
usage(progname);
|
||||
fprintf( stderr, "\nExecute SQL commands on SQLite databases\n\n"
|
||||
@ -375,7 +403,8 @@ static void help(const char* progname) {
|
||||
" -S, String to separate columns in query \n"
|
||||
" --column-separator=SEP results (default \"|\")\n"
|
||||
" -v, --verbose Log details to stderr\n"
|
||||
" -V, --version, Print program version details to stderr\n"
|
||||
" -V, --version, Print program version, licensing and \n"
|
||||
" warranty details to stderr, and continue\n"
|
||||
" -- Subsequent parameters are not options\n"
|
||||
" -h, --help, -? Print this help to stderr and exit\n"
|
||||
"\nTo cancel reading from stdin in a POSIX shell, use the input \nredirection \"<&-\".\n" );
|
||||
@ -417,6 +446,7 @@ int main(int argc, char *argv[]) {
|
||||
/* basename() may modify its argument */
|
||||
fprintf( stderr, "%s SQLite exec wrapper version %s\n",
|
||||
basename(strdup(zProgName)), zVersionNo);
|
||||
gpl();
|
||||
}
|
||||
else if (0 == optcmp(argv[1], zVerbose, NULL)) {
|
||||
fDbg = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user