-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0e8698a
commit 9ab229d
Showing
4 changed files
with
67 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#pragma once | ||
|
||
#include <all.hpp> | ||
|
||
class StartCommand : public liteshell::BaseCommand | ||
{ | ||
public: | ||
StartCommand() | ||
: liteshell::BaseCommand( | ||
"start", | ||
"Starts a new window of the command shell, run the specified command and exit.", | ||
"", | ||
liteshell::CommandConstraint("command", "The command line to run", true)) {} | ||
|
||
DWORD run(const liteshell::Context &context) | ||
{ | ||
auto command = context.get("command"); | ||
context.client->spawn_subprocess( | ||
utils::format("%s \"%s\"", utils::get_executable_path().c_str(), command.c_str()), | ||
true, // no effect | ||
true); | ||
|
||
return 0; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters