improved log out, fixed help message output, Makefile now generates man page
This commit is contained in:
parent
6713362a5f
commit
07603c36ba
6
Makefile
6
Makefile
|
@ -55,15 +55,19 @@ ifeq ($(OS),Darwin)
|
||||||
$(DESTDIR)$(prefix)/share/man/man1/httpdirfs.1
|
$(DESTDIR)$(prefix)/share/man/man1/httpdirfs.1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
man: all
|
||||||
|
help2man --no-discard-stderr ./httpdirfs > doc/man/httpdirfs.1
|
||||||
|
|
||||||
doc:
|
doc:
|
||||||
doxygen Doxyfile
|
doxygen Doxyfile
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
-rm -f *.o
|
-rm -f *.o
|
||||||
-rm -f httpdirfs
|
-rm -f httpdirfs
|
||||||
-rm -rf doc/html
|
|
||||||
|
|
||||||
distclean: clean
|
distclean: clean
|
||||||
|
-rm -rf doc/html
|
||||||
|
-rm -rf doc/man/httpdirfs.1
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
-rm -f $(DESTDIR)$(prefix)/bin/httpdirfs
|
-rm -f $(DESTDIR)$(prefix)/bin/httpdirfs
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.8.
|
.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.48.1.
|
||||||
.TH HTTPDIRFS "1" "August 2021" "HTTPDirFS version 1.2.2" "User Commands"
|
.TH HTTPDIRFS "1" "August 2021" "HTTPDirFS version 1.2.3" "User Commands"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
HTTPDirFS \- manual page for HTTPDirFS version 1.2.2
|
HTTPDirFS \- manual page for HTTPDirFS version 1.2.3
|
||||||
.SH DESCRIPTION
|
.SH DESCRIPTION
|
||||||
usage: ./httpdirfs [options] URL mountpoint
|
usage: ./httpdirfs [options] URL mountpoint
|
||||||
.SS "General options:"
|
.SS "general options:"
|
||||||
.TP
|
.TP
|
||||||
\fB\-\-config\fR
|
\fB\-\-config\fR
|
||||||
Specify a configuration file
|
Specify a configuration file
|
||||||
|
@ -72,6 +72,28 @@ for HTTP range requests
|
||||||
\fB\-\-insecure_tls\fR
|
\fB\-\-insecure_tls\fR
|
||||||
Disable licurl TLS certificate verification by
|
Disable licurl TLS certificate verification by
|
||||||
setting CURLOPT_SSL_VERIFYHOST to 0
|
setting CURLOPT_SSL_VERIFYHOST to 0
|
||||||
|
.TP
|
||||||
|
\fB\-\-single\-file\-mode\fR
|
||||||
|
Single file mode \- rather than mounting a whole
|
||||||
|
directory, present a single file inside a virtual
|
||||||
|
directory.
|
||||||
|
.IP
|
||||||
|
For mounting a Airsonic / Subsonic server:
|
||||||
|
.TP
|
||||||
|
\fB\-\-sonic\-username\fR
|
||||||
|
The username for your Airsonic / Subsonic server
|
||||||
|
.TP
|
||||||
|
\fB\-\-sonic\-password\fR
|
||||||
|
The password for your Airsonic / Subsonic server
|
||||||
|
.TP
|
||||||
|
\fB\-\-sonic\-id3\fR
|
||||||
|
Enable ID3 mode \- this present the server content in
|
||||||
|
Artist/Album/Song layout
|
||||||
|
.TP
|
||||||
|
\fB\-\-sonic\-insecure\fR
|
||||||
|
Authenticate against your Airsonic / Subsonic server
|
||||||
|
using the insecure username / hex encoded password
|
||||||
|
scheme
|
||||||
.SS "FUSE options:"
|
.SS "FUSE options:"
|
||||||
.TP
|
.TP
|
||||||
\fB\-d\fR \fB\-o\fR debug
|
\fB\-d\fR \fB\-o\fR debug
|
||||||
|
@ -225,9 +247,9 @@ prepend this directory to all paths (mandatory)
|
||||||
\fB\-o\fR [no]rellinks
|
\fB\-o\fR [no]rellinks
|
||||||
transform absolute symlinks to relative
|
transform absolute symlinks to relative
|
||||||
.PP
|
.PP
|
||||||
libcurl SSL engine: OpenSSL/1.1.1d
|
libcurl SSL engine: OpenSSL/1.1.1k
|
||||||
FUSE library version: 2.9.9
|
FUSE library version: 2.9.9
|
||||||
fusermount version: 2.9.9
|
fusermount3 version: 3.10.3
|
||||||
using FUSE kernel interface version 7.19
|
using FUSE kernel interface version 7.19
|
||||||
.SH "SEE ALSO"
|
.SH "SEE ALSO"
|
||||||
The full documentation for
|
The full documentation for
|
||||||
|
|
17
src/log.c
17
src/log.c
|
@ -20,38 +20,37 @@ void
|
||||||
log_printf(LogType type, const char *file, const char *func, int line,
|
log_printf(LogType type, const char *file, const char *func, int line,
|
||||||
const char *format, ...)
|
const char *format, ...)
|
||||||
{
|
{
|
||||||
FILE *out = stderr;
|
|
||||||
if (type & CONFIG.log_type) {
|
if (type & CONFIG.log_type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case fatal:
|
case fatal:
|
||||||
fprintf(out, "Fatal:");
|
fprintf(stderr, "Fatal:");
|
||||||
break;
|
break;
|
||||||
case error:
|
case error:
|
||||||
fprintf(out, "Error:");
|
fprintf(stderr, "Error:");
|
||||||
break;
|
break;
|
||||||
case warning:
|
case warning:
|
||||||
fprintf(out, "Warning:");
|
fprintf(stderr, "Warning:");
|
||||||
break;
|
break;
|
||||||
case info:
|
case info:
|
||||||
goto print_actual_message;
|
goto print_actual_message;
|
||||||
default:
|
default:
|
||||||
fprintf(out, "Debug(%x):", type);
|
fprintf(stderr, "Debug(%x):", type);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(out, "%s:%d:", file, line);
|
fprintf(stderr, "%s:%d:", file, line);
|
||||||
|
|
||||||
print_actual_message:
|
print_actual_message:
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
fprintf(out, "%s: ", func);
|
fprintf(stderr, "%s: ", func);
|
||||||
va_list args;
|
va_list args;
|
||||||
va_start(args, format);
|
va_start(args, format);
|
||||||
vfprintf(out, format, args);
|
vfprintf(stderr, format, args);
|
||||||
va_end(args);
|
va_end(args);
|
||||||
|
|
||||||
if (type == fatal) {
|
if (type == fatal) {
|
||||||
exit_failure();
|
exit_failure();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
11
src/main.c
11
src/main.c
|
@ -324,7 +324,8 @@ void add_arg(char ***fuse_argv_ptr, int *fuse_argc, char *opt_string)
|
||||||
|
|
||||||
static void print_help(char *program_name, int long_help)
|
static void print_help(char *program_name, int long_help)
|
||||||
{
|
{
|
||||||
printf("usage: %s [options] URL mountpoint\n", program_name);
|
/* FUSE prints its help to stderr */
|
||||||
|
fprintf(stderr, "usage: %s [options] URL mountpoint\n", program_name);
|
||||||
if (long_help) {
|
if (long_help) {
|
||||||
print_long_help();
|
print_long_help();
|
||||||
}
|
}
|
||||||
|
@ -332,17 +333,19 @@ static void print_help(char *program_name, int long_help)
|
||||||
|
|
||||||
static void print_version()
|
static void print_version()
|
||||||
{
|
{
|
||||||
printf("HTTPDirFS version " VERSION "\n");
|
/* FUSE prints its help to stderr */
|
||||||
|
fprintf(stderr, "HTTPDirFS version " VERSION "\n");
|
||||||
/*
|
/*
|
||||||
* --------- Print off SSL engine version ---------
|
* --------- Print off SSL engine version ---------
|
||||||
*/
|
*/
|
||||||
curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
|
curl_version_info_data *data = curl_version_info(CURLVERSION_NOW);
|
||||||
printf("libcurl SSL engine: %s\n", data->ssl_version);
|
fprintf(stderr, "libcurl SSL engine: %s\n", data->ssl_version);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void print_long_help()
|
static void print_long_help()
|
||||||
{
|
{
|
||||||
printf("\n\
|
/* FUSE prints its help to stderr */
|
||||||
|
fprintf(stderr, "\n\
|
||||||
general options:\n\
|
general options:\n\
|
||||||
--config Specify a configuration file \n\
|
--config Specify a configuration file \n\
|
||||||
-o opt,[opt...] Mount options\n\
|
-o opt,[opt...] Mount options\n\
|
||||||
|
|
Loading…
Reference in New Issue