Skip to content
Snippets Groups Projects
Commit faf6055b authored by Eric Vidal's avatar Eric Vidal :speech_balloon:
Browse files

combime 66 all and 66 tree in one tool

parent d2300931
No related branches found
No related tags found
No related merge requests found
......@@ -119,7 +119,6 @@ int main(int argc, char const *const *argv)
if (!set_ownersysdir(&info.base, info.owner))
log_dieusys(LOG_EXIT_SYS, "set owner directory") ;
if (!strcmp(argv[1], "boot")) {
PROG = "boot" ;
......@@ -182,11 +181,11 @@ int main(int argc, char const *const *argv)
PROG = "all" ;
nargv[n++] = PROG ;
info.prog = PROG ;
info.help = help_all ;
info.usage = usage_all ;
func = &ssexec_all ;
info.help = help_treectl ;
info.usage = usage_treectl ;
func = &ssexec_treectl ;
auto_strings(opts, main, OPTS_ALL) ;
auto_strings(opts, main, OPTS_TREECTL) ;
} else if (!strcmp(argv[1], "env")) {
......@@ -281,10 +280,7 @@ int main(int argc, char const *const *argv)
PROG = "tree" ;
nargv[n++] = PROG ;
info.prog = PROG ;
info.help = help_tree ;
info.usage = usage_tree ;
func = &ssexec_tree ;
func = &ssexec_tree_wrapper ;
auto_strings(opts, main, OPTS_TREE) ;
......
......@@ -110,7 +110,7 @@ extern ssexec_func_t ssexec_start ;
extern ssexec_func_t ssexec_stop ;
extern ssexec_func_t ssexec_svctl ;
extern ssexec_func_t ssexec_env ;
extern ssexec_func_t ssexec_all ;
extern ssexec_func_t ssexec_treectl ;
extern ssexec_func_t ssexec_tree ;
extern ssexec_func_t ssexec_reconfigure ;
extern ssexec_func_t ssexec_reload ;
......@@ -122,6 +122,7 @@ extern ssexec_func_t ssexec_inservice ;
extern ssexec_func_t ssexec_boot ;
extern ssexec_func_t ssexec_scanctl ;
extern ssexec_func_t ssexec_scandir ;
extern ssexec_func_t ssexec_tree_wrapper ;
extern char const *usage_parse ;
extern char const *help_parse ;
......@@ -139,8 +140,8 @@ extern char const *usage_init ;
extern char const *help_init ;
extern char const *usage_env ;
extern char const *help_env ;
extern char const *usage_all ;
extern char const *help_all ;
extern char const *usage_treectl ;
extern char const *help_treectl ;
extern char const *usage_tree ;
extern char const *help_tree ;
extern char const *usage_reconfigure ;
......@@ -185,9 +186,9 @@ extern char const *usage_66 ;
#define OPTS_SVCTL_LEN (sizeof OPTS_SVCTL - 1)
#define OPTS_ENV "c:s:VLr:e:i:"
#define OPTS_ENV_LEN (sizeof OPTS_ENV - 1)
#define OPTS_ALL "f"
#define OPTS_ALL_LEN (sizeof OPTS_ALL - 1)
#define OPTS_TREE "na:d:cS:EDRC:o:"
#define OPTS_TREECTL "f"
#define OPTS_TREECTL_LEN (sizeof OPTS_TREECTL - 1)
#define OPTS_TREE "co:EDRnadC:S:"
#define OPTS_TREE_LEN (sizeof OPTS_TREE - 1)
#define OPTS_INRESOLVE ""
#define OPTS_INRESOLVE_LEN (sizeof OPTS_INRESOLVE - 1)
......
......@@ -21,6 +21,8 @@ ssexec_start.o
ssexec_stop.o
ssexec_svctl.o
ssexec_tree.o
ssexec_treectl.o
ssexec_tree_wrapper.o
-ls6
-loblibs
-lskarnet
......
......@@ -127,9 +127,9 @@ char const *help_env =
" -e: edit the file with editor\n"
;
char const *usage_all = "66 all [ -h ] [ -z ] [ -v verbosity ] [ -T timeout ] [ -l live ] [ -t tree ] [ -f ] up|down|unsupervise" ;
char const *usage_treectl = "66 treectl [ -h ] [ -z ] [ -v verbosity ] [ -T timeout ] [ -l live ] [ -t tree ] [ -f ] up|down|unsupervise" ;
char const *help_all =
char const *help_treectl =
"\n"
"options:\n"
" -h: print this help\n"
......@@ -166,15 +166,29 @@ char const *help_tree =
" clone=: make a clone of tree\n"
" noseed: do not use seed file to build the tree\n"
;
*/
char const *usage_tree = "66 tree [ -h ] [ -z ] [ -v verbosity ] [ -T timeout ] [ -l live ] create|admin|remove|enable|disable|current|up|down|unsupervise [ -f ] [ -o depends=:... ] tree" ;
char const *usage_treectl = "66 treectl [ -h ] [ -z ] [ -v verbosity ] tree" ;
char const *help_treectl =
char const *help_tree =
"\n"
"options:\n"
" -h: print this help\n"
" -z: use color\n"
" -v: increase/decrease verbosity\n"
" -T: timeout\n"
" -f: fork the process\n"
" -o: colon separated list of options\n"
"\n"
"valid fields for -o options are:\n"
"\n"
" depends=: comma separated list of dependencies for tree or none\n"
" requiredby=: comma separated list of trees required by tree or none\n"
" groups=: add tree to the specified groups\n"
" allow=: comma separated list of account to allow at tree\n"
" deny=: comma separated list of account to deny at tree\n"
" clone=: make a clone of tree\n"
" noseed: do not use seed file to build the tree\n"
;
char const *usage_reconfigure = "66 reconfigure [ -h ] [ -z ] [ -v verbosity ] [ -l live ] [ -t tree ] [ -T timeout ] [ -P ] service(s)" ;
......
......@@ -150,7 +150,6 @@ static void scandir_up(char const *scandir, unsigned int timeout, unsigned int n
newup[m++] = scandir ;
newup[m++] = 0 ;
//log_info("Starts scandir ",scandir," ...") ;
xexec_ae(newup[0], newup, envp) ;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment