Argp使用全局变量 this.coursesData.LoadLectures()
.subscribe(LectureList=> {
LectureList.forEach(lecture=>{
var newLecture={
name:lecture.name,
email:lecture.email,
phone:lecture.phone ,
lesson_type:lecture.lesson_type ,
detailsHours:{
'start_time':lecture.start_time,
'end_time':lecture.end_time,
'class':lecture.class,
'day':lecture.day},
details:lecture.details,
course_name:lecture.course_name
}
/*here i want to do something like:
` if(id_course==" `
to the same course i have already push into courseA)
so to push only the detailsHours to the object.
because what i want to do each course has many lessons.*/
this.coursesA.push(newLecture);
this.coursesNames.push(lecture.course_name);
this.LecturesNames.push(lecture.name);
});
this.coursesAD=this.coursesA;
this.coursesNames = this.coursesNames.filter(function(elem, index, self) {
return index == self.indexOf(elem);
})
this.loader.dismiss();
},err=>{
console.log(err);
});
和const char * argp_program_version
公开版本和错误信息。但是,如果源被分成几个文件,那么如何设置这些变量并不是很明显。全局设置(const char * argp_program_bug_address
或main.cpp
中的定义,parser.cpp
中的定义)似乎根本不起作用。
我应该如何设置这些变量,以便argp了解它们?