mirror of
https://github.com/lucaspalomodevelop/autom.git
synced 2026-03-12 23:27:21 +00:00
added ls to help output
This commit is contained in:
parent
459132eb8e
commit
3ce6f71757
@ -22,6 +22,7 @@ void input(int argc, char *argv[])
|
||||
command.addCommand("run", runScript);
|
||||
command.addCommand("help", help);
|
||||
command.addCommand("ls", listScripts);
|
||||
command.addCommand("add", addScript);
|
||||
command.addDefaultCommand(runScript);
|
||||
command.runCommand(argv[1], argc, argv);
|
||||
}
|
||||
@ -48,6 +49,13 @@ void listScripts(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
// add a script to the autom directory
|
||||
void addScript(int argc, char *argv[])
|
||||
{
|
||||
std::string scriptname = argv[2];
|
||||
std::ofstream{dir + "/" + scriptname};
|
||||
}
|
||||
|
||||
// help function for showing help message
|
||||
void help(int argc, char *argv[])
|
||||
{
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
#include <string>
|
||||
#include <sys/stat.h>
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
|
||||
#include "inputparser.h"
|
||||
#include "command.h"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user