mirror of
https://github.com/roswell/roswell.git
synced 2026-09-10 07:16:17 -04:00
change sub-sub-commanad for config sub command.
This commit is contained in:
parent
e7feb10ca4
commit
8d1ddbbede
17
src/opt.c
17
src/opt.c
|
|
@ -190,18 +190,17 @@ int cmd_opt(int argc, const char **argv)
|
|||
struct opts* opt=global_opt;
|
||||
struct opts** opts=&opt;
|
||||
if(argc==0) {
|
||||
printf("local:\n");
|
||||
printf("oneshot:\n");
|
||||
print_opts(local_opt);
|
||||
printf("global:\n");
|
||||
printf("local:\n");
|
||||
print_opts(opt);
|
||||
}else if(strcmp(argv[0],"set")==0) {
|
||||
if(argc>=3) {
|
||||
set_opt(opts, argv[1],(char*)argv[2],0);
|
||||
}else {
|
||||
// TBD parse options
|
||||
if(argc==1) {
|
||||
unset_opt(opts, argv[0]);
|
||||
save_opts(path,opt);
|
||||
}
|
||||
}else if(strcmp(argv[0],"unset")==0) {
|
||||
if(argc>=2) {
|
||||
unset_opt(opts, argv[1]);
|
||||
}else if(argc==2) {
|
||||
set_opt(opts, argv[0],(char*)argv[1],0);
|
||||
save_opts(path,opt);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue