summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Woodward2011-04-30 01:03:29 -0400
committerJason Woodward2011-04-30 01:03:29 -0400
commitd65854f661696852c4b12a03b5206b7bc617040d (patch)
tree26d679a2afc296adbbe79173c2a2d3ceeec62bee /src
parent99c4184bdc4d82e41445e52677654bef7223c8f5 (diff)
downloadslapt-get-d65854f661696852c4b12a03b5206b7bc617040d.tar.gz
moved --version logout prior to reading config file
If for some insane reason you are trying to use slapt-get w/o a config and don't like the unable to open config error, this will make you happy.
Diffstat (limited to 'src')
-rw-r--r--src/main.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/main.c b/src/main.c
index 10323f4..57fdcd3 100644
--- a/src/main.c
+++ b/src/main.c
@@ -147,8 +147,10 @@ int main( int argc, char *argv[] )
initial_config->simulate = SLAPT_TRUE;
break;
case SLAPT_VERSION_OPT: /* version */
- do_action = SHOWVERSION;
- break;
+ version_info();
+ slapt_free_rc_config(initial_config);
+ curl_global_cleanup();
+ exit(EXIT_SUCCESS);
case SLAPT_NO_PROMPT_OPT: /* auto */
initial_config->no_prompt = SLAPT_TRUE;
break;
@@ -295,13 +297,6 @@ int main( int argc, char *argv[] )
exit(EXIT_FAILURE);
}
- if ( do_action == SHOWVERSION ) {
- version_info();
- slapt_free_rc_config(global_config);
- curl_global_cleanup();
- exit(EXIT_SUCCESS);
- }
-
/* create the working directory if needed */
slapt_working_dir_init(global_config);
if ((chdir(global_config->working_dir)) == -1) {