main.cpp

来自「这是一个linux下的Shell.有命令历史和命令提示」· C++ 代码 · 共 44 行

CPP
44
字号
// main.cpp : Defines the entry point for the console application.//#include "ProgramableShell.h"#include <iostream>using namespace std;int main (int argc, char *argv[]){	ProgramableShell MyLover;	if(argc < 2)	{		while(1)		{			MyLover.getinput_stdin();			while(MyLover.getcommand())			{				MyLover.run();			}			}	}	else	{		int fid = open(argv[1],O_RDONLY);		if(fid<0)		{			cout<<"lover:" <<argv[1]<<"open file fautt"<<endl;			return 1;		}		else		{			MyLover.load(fid);			while(1)			{				MyLover.getinput_file();				while(MyLover.getcommand())				{					MyLover.run();				}				}		}	}	return 0;}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?