Skip to content
Snippets Groups Projects
Commit 8f455103 authored by BRONES Romain's avatar BRONES Romain
Browse files

fix(CLI): Change behavior for config

* Only picked value allowed (nargs = ?)
* Default is 'all', not handled by argparse
parent b70486b0
No related branches found
No related tags found
No related merge requests found
......@@ -52,9 +52,10 @@ if __name__ == '__main__':
parser.add_argument("--stop-ccn", action="store_true",
help="Stop command for the ComBPM applications blocks.")
parser.add_argument("--configure", choices=["combpm", "ccn", "comcorr", "corr", "all", "every"], nargs="+",
parser.add_argument("--configure", choices=["combpm", "ccn", "comcorr", "corr", "all", "every"],
nargs='?', const='all',
help="Configuration commands for the Fofb applications blocs."+
" 'all' is for all com, not configuring corrector. 'every' configure everything.")
" 'all' is for all com, not configuring corrector. 'every' configure everything. Default is 'all'")
parser.add_argument("--start", action="store_true",
help="Start command for the CCN and ComBPM applications blocks.")
......@@ -99,16 +100,14 @@ if __name__ == '__main__':
if args.stop or args.stop_ccn:
FofbTool.Utils.stop_all_ccn()
if not args.configure is None:
for conf in args.configure:
if conf in ("combpm", "all", "every"):
FofbTool.Utils.conf_all_combpm()
if conf in ("comcorr", "all", "every"):
FofbTool.Utils.conf_all_comcorr()
if conf in ("ccn", "all", "every"):
FofbTool.Utils.conf_all_ccn()
if conf in ("corr", "every"):
FofbTool.Configuration.centralnode_configure_corr()
if args.configure in ("combpm", "all", "every"):
FofbTool.Utils.conf_all_combpm()
if args.configure in ("comcorr", "all", "every"):
FofbTool.Utils.conf_all_comcorr()
if args.configure in ("ccn", "all", "every"):
FofbTool.Utils.conf_all_ccn()
if args.configure in ("corr", "every"):
FofbTool.Configuration.centralnode_configure_corr()
if args.start or args.start_combpm:
FofbTool.Utils.start_all_combpm()
......
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