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

deprecated -c option and use -z instead. This change is made to be consistent...

deprecated -c option and use -z instead. This change is made to be consistent with option between tools
parent 1b8de266
No related branches found
No related tags found
No related merge requests found
......@@ -103,7 +103,7 @@ info_opts_map_t const opts_sv_table[] =
#define checkopts(n) if (n >= MAXOPTS) strerr_dief1x(100, "too many options")
#define DELIM ','
#define USAGE "66-inservice [ -h ] [ -v verbosity ] [ -c ] [ -n ] [ -o name,intree,status,... ] [ -g ] [ -d depth ] [ -r ] [ -t tree ] [ -p nline ] service"
#define USAGE "66-inservice [ -h ] [ -z ] [ -v verbosity ] [ -n ] [ -o name,intree,status,... ] [ -g ] [ -d depth ] [ -r ] [ -t tree ] [ -p nline ] service"
static inline void info_help (void)
{
......@@ -112,8 +112,8 @@ static inline void info_help (void)
"\n"
"options :\n"
" -h: print this help\n"
" -v: increase/decrease verbosity\n"
" -c: use color\n"
" -v: increase/decrease verbosity\n"
" -n: do not display the field name\n"
" -o: comma separated list of field to display\n"
" -g: displays the contents field as graph\n"
......@@ -643,14 +643,14 @@ int main(int argc, char const *const *argv, char const *const *envp)
for (;;)
{
int opt = getopt_args(argc,argv, ">hv:cno:grd:t:p:", &l) ;
int opt = getopt_args(argc,argv, ">hzv:cno:grd:t:p:", &l) ;
if (opt == -1) break ;
if (opt == -2) log_die(LOG_EXIT_USER,"options must be set first") ;
switch (opt)
{
case 'h' : info_help(); return 0 ;
case 'v' : if (!uint0_scan(l.arg, &VERBOSITY)) log_usage(USAGE) ; break ;
case 'c' : log_color = !isatty(1) ? &log_color_disable : &log_color_enable ; break ;
case 'z' : log_color = !isatty(1) ? &log_color_disable : &log_color_enable ; break ;
case 'n' : NOFIELD = 0 ; break ;
case 'o' : legacy = 0 ; info_parse_options(l.arg,what) ; break ;
case 'g' : GRAPH = 1 ; break ;
......@@ -658,6 +658,7 @@ int main(int argc, char const *const *argv, char const *const *envp)
case 'd' : if (!uint0_scan(l.arg, &MAXDEPTH)) log_usage(USAGE) ; break ;
case 't' : tname = l.arg ; break ;
case 'p' : if (!uint0_scan(l.arg, &nlog)) log_usage(USAGE) ; break ;
case 'c' : log_die(LOG_EXIT_SYS,"deprecated option -- please use -z instead") ;
default : log_usage(USAGE) ;
}
}
......
......@@ -79,7 +79,7 @@ info_opts_map_t const opts_tree_table[] =
#define checkopts(n) if (n >= MAXOPTS) log_die(100, "too many options")
#define DELIM ','
#define USAGE "66-intree [ -h ] [ -v verbosity ] [ -l live ] [ -c ] [ -n ] [ -o name,init,enabled,... ] [ -g ] [ -d depth ] [ -r ] tree"
#define USAGE "66-intree [ -h ] [ -z ] [ -v verbosity ] [ -l live ] [ -n ] [ -o name,init,enabled,... ] [ -g ] [ -d depth ] [ -r ] tree"
static inline void info_help (void)
{
......@@ -88,9 +88,9 @@ static inline void info_help (void)
"\n"
"options :\n"
" -h: print this help\n"
" -z: use color\n"
" -v: increase/decrease verbosity\n"
" -l: live directory\n"
" -c: use color\n"
" -n: do not display the names of fields\n"
" -o: comma separated list of field to display\n"
" -g: displays the contents field as graph\n"
......@@ -498,14 +498,14 @@ int main(int argc, char const *const *argv, char const *const *envp)
for (;;)
{
int opt = getopt_args(argc,argv, ">hv:cno:grd:l:", &l) ;
int opt = getopt_args(argc,argv, ">hzv:no:grd:l:c", &l) ;
if (opt == -1) break ;
if (opt == -2) log_die(LOG_EXIT_USER,"options must be set first") ;
switch (opt)
{
case 'h' : info_help(); return 0 ;
case 'v' : if (!uint0_scan(l.arg, &VERBOSITY)) log_usage(USAGE) ; break ;
case 'c' : log_color = !isatty(1) ? &log_color_disable : &log_color_enable ; break ;
case 'z' : log_color = !isatty(1) ? &log_color_disable : &log_color_enable ; break ;
case 'n' : NOFIELD = 0 ; break ;
case 'o' : legacy = 0 ; info_parse_options(l.arg,what) ; break ;
case 'g' : GRAPH = 1 ; break ;
......@@ -514,6 +514,7 @@ int main(int argc, char const *const *argv, char const *const *envp)
case 'l' : if (!stralloc_cats(&live,l.arg)) log_usage(USAGE) ;
if (!stralloc_0(&live)) log_usage(USAGE) ;
break ;
case 'c' : log_die(LOG_EXIT_SYS,"deprecated option -- please use -z instead") ;
default : log_usage(USAGE) ;
}
}
......
......@@ -38,7 +38,7 @@
#include <66/resolve.h>
#include <66/parser.h>
#define USAGE "66-update [ -h ] [ -c ] [ -v verbosity ] [ -l live ] [ -d ] tree(s)"
#define USAGE "66-update [ -h ] [ -z ] [ -v verbosity ] [ -l live ] [ -d ] tree(s)"
static stralloc WORKDIR = STRALLOC_ZERO ;
static uint8_t DRYRUN = 0 ;
......@@ -50,7 +50,7 @@ static inline void info_help (void)
"\n"
"options :\n"
" -h: print this help\n"
" -c: use color\n"
" -z: use color\n"
" -v: increase/decrease verbosity\n"
" -l: live directory\n"
" -d: dry run\n"
......@@ -195,7 +195,7 @@ int main(int argc, char const *const *argv,char const *const *envp)
subgetopt_t l = SUBGETOPT_ZERO ;
for (;;)
{
int opt = subgetopt_r(argc,argv, "hv:l:cd", &l) ;
int opt = subgetopt_r(argc,argv, "hzv:l:dc", &l) ;
if (opt == -1) break ;
switch (opt)
......@@ -205,8 +205,9 @@ int main(int argc, char const *const *argv,char const *const *envp)
case 'l' : if (!stralloc_cats(&info.live,l.arg)) log_die_nomem("stralloc") ;
if (!stralloc_0(&info.live)) log_die_nomem("stralloc") ;
break ;
case 'c' : log_color = !isatty(1) ? &log_color_disable : &log_color_enable ; break ;
case 'z' : log_color = !isatty(1) ? &log_color_disable : &log_color_enable ; break ;
case 'd' : DRYRUN = 1 ; break ;
case 'c' : log_die(LOG_EXIT_SYS,"deprecated option -- please use -z instead") ;
default : log_usage(USAGE) ;
}
}
......
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