git-svn-id: svn://db.shs.com.ru/pip@242 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -17,10 +17,11 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "picli.h"
|
||||
#include "pisingleapplication.h"
|
||||
#include "pisystemmonitor.h"
|
||||
#include "pisysteminfo.h"
|
||||
#include "piprocess.h"
|
||||
#include "picli.h"
|
||||
#include "file_manager.h"
|
||||
#include "daemon.h"
|
||||
#include "shared.h"
|
||||
@@ -285,14 +286,24 @@ int main(int argc, char * argv[]) {
|
||||
cli.addArgument("help");
|
||||
cli.addArgument("daemon");
|
||||
cli.addArgument("force");
|
||||
cli.addArgument("1");
|
||||
cli.addArgument("name", true);
|
||||
if (cli.hasArgument("help")) {
|
||||
usage();
|
||||
return 0;
|
||||
}
|
||||
PIString name = cli.argumentValue("name");
|
||||
PISingleApplication * sapp = 0;
|
||||
if (cli.hasArgument("1") && !cli.hasArgument("force")) {
|
||||
sapp = new PISingleApplication("pisd");
|
||||
if (!sapp->isFirst()) {
|
||||
piCout << "Another pisd is running, exit";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (cli.hasArgument("daemon")) {
|
||||
PIStringList args;
|
||||
args << "-1";
|
||||
if (cli.hasArgument("force"))
|
||||
args << "-f";
|
||||
if (!name.isEmpty())
|
||||
@@ -314,5 +325,6 @@ int main(int argc, char * argv[]) {
|
||||
delete menu;
|
||||
delete daemon;
|
||||
delete screen;
|
||||
if (sapp) delete sapp;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user