Skip to content

Commit

Permalink
Add exit command
Browse files Browse the repository at this point in the history
  • Loading branch information
Sife-shuo committed Aug 21, 2023
1 parent 401a2a7 commit 1b447d9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ Type Abbreviation List(Currently not supported for wchar_t)
[ Out ] >> [1:1-2B]:
[ Out ] >> [2:2-3B]:
[ Out ] >> [3:3-4B]:@
```
```
+ ### exit
Enter exit to exit.
3 changes: 3 additions & 0 deletions command.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ void usage(){
cout<<OUT<<"Wrong TypeName\n";
}
}
}else if(u=="exit"){//exit
cout<<"[ Exit ]";
throw 0;
}
}
}
Expand Down
8 changes: 7 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@ int main(){
cout<<IN;
//string h;
//getline(cin,h);
usage();
try{
usage();
}catch(int err){
if(err==0){
return 0;
}
}
}
return 0;
}

0 comments on commit 1b447d9

Please sign in to comment.