diff options
author | Robert C. Helling <helling@atdotde.de> | 2015-09-23 11:13:07 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-10-04 16:29:31 +0100 |
commit | a241393e7b465ec0f263a7afaf20f7b65617adae (patch) | |
tree | 4cb6886134bba214c1918c3bbd927f88058cfe89 /subsurfacestartup.c | |
parent | 3f900885df21200722b11bc09dad70af588e398e (diff) | |
download | subsurface-a241393e7b465ec0f263a7afaf20f7b65617adae.tar.gz |
Print paths to internal files in verbose mode
When run with -v option, this prints local file names like the path
to the local git repository and the hash file.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurfacestartup.c')
-rw-r--r-- | subsurfacestartup.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/subsurfacestartup.c b/subsurfacestartup.c index fd5df09ab..ef2eb2cd5 100644 --- a/subsurfacestartup.c +++ b/subsurfacestartup.c @@ -3,6 +3,9 @@ #include <stdbool.h> #include <string.h> #include "gettext.h" +#include "qthelperfromc.h" +#include "git-access.h" + struct preferences prefs, informational_prefs; struct preferences default_prefs = { .cloud_base_url = "https://cloud.subsurface-divelog.org/", @@ -134,6 +137,22 @@ static void print_version() printf("built with libdivecomputer v%s\n", dc_version(NULL)); } +void print_files() +{ + const char *branchp, *remote; + const char *filename, *local_git; + + filename = cloud_url(); + + is_git_repository(filename, &branchp, &remote, true); + local_git = get_local_dir(remote, branchp); + printf("\nFile locations:\n\n"); + printf("Local git storage: %s\n", local_git); + printf("Cloud URL: %s\n", cloud_url()); + printf("Image hashes: %s\n", hashfile_name_string()); + printf("Local picture directory: %s\n\n", picturedir_string()); +} + static void print_help() { print_version(); |