Skip to content

Commit

Permalink
Delete stack & Open link
Browse files Browse the repository at this point in the history
  • Loading branch information
HojdaAdelin committed Jun 2, 2023
1 parent ea4bf42 commit 49ccc14
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ view 'file name' Display the content of a file
stack 'link' Store a link
.web Open stores link
view stack Display stored link
open 'link' Open a link
delete stack Delete stored link

</pre>

Expand Down
6 changes: 4 additions & 2 deletions src/Service/CommandsHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ void help(std::string ServiceString) {
if (ServiceString == "help") {
commandHelp();
} else if (ServiceString == "version") {
std::cout << "\nVersion: 1.0.9\n";
std::cout << "\nVersion: 1.1.1\n";
} else if (ServiceString == "log") {
std::cout << "\n-Downloaded apps\n-VS Code command\n-Open app\n-File content view\n-Text highlight\n-Stack 'link'\n-.web\n-Added icon\n-Stored link view\n";
std::cout << "\n-Downloaded apps\n-VS Code command\n-Open app\n-File content view\n-Text highlight\n-Stack 'link'\n-.web\n-Added icon\n-Stored link view\n-Delete stack\n-Open link\n";
} else if (ServiceString == ".git" || ".bug" || ".source") {
WebOpener(ServiceString);
}
Expand Down Expand Up @@ -44,6 +44,8 @@ void commandHelp() {
std::cout << "stack 'link' Store a link enter by the user\n";
std::cout << ".web Open the link was stored\n";
std::cout << "view stack Display stored link\n";
std::cout << "open 'link' Open a link\n";
std::cout << "delete stack Delete stored link\n";


}
21 changes: 20 additions & 1 deletion src/Settings/UserInputWebOpenerFunction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ void openStackedLink() {
readLink >> link;

readLink.close();

system(std::string("start " + link).c_str());


}

void viewStackedLink() {
Expand All @@ -43,4 +44,22 @@ void viewStackedLink() {
std::cout << link << std::endl;
SetConsoleTextAttribute(storedLink, 15);

}

void userOpenLink(std::string inputLink) {

system(std::string("start " + inputLink).c_str());

}

void userLinkDelete() {

std::ofstream deleteLink("link.txt");

deleteLink << " " << std::endl;

deleteLink.close();

std::cout << "The link was deleted!" << std::endl;

}
4 changes: 3 additions & 1 deletion src/include.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ void viewFileContent(const std::string& fileName);
void highlightKeywords(const std::string& line);
void stackLink(std::string stack);
void openStackedLink();
void viewStackedLink();
void viewStackedLink();
void userOpenLink(std::string inputLink);
void userLinkDelete();
12 changes: 12 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,18 @@ int main() {
stackLink(link);
std::cout << "\n";

} else if (command.substr(0, 5) =="open ") {

std::cout << "\n";
std::string link = command.substr(5);
userOpenLink(link);

} else if (command == "delete stack") {

std::cout << "\n";
userLinkDelete();
std::cout << "\n";

} else if (command == ".web") {

openStackedLink();
Expand Down

0 comments on commit 49ccc14

Please sign in to comment.