diff --git a/doc/man.html b/doc/man.html index 945a2072..9d1ffef8 100644 --- a/doc/man.html +++ b/doc/man.html @@ -190,7 +190,7 @@
-a, ---autocmd=COMMAND
+--autocmd=COMMAND | @FILENAMEpass command to execute to the emulator. The option can be repeated to pass multiple @@ -198,6 +198,10 @@
with prefix "@", a +filename is specified. All commands in the file are passed. +For example: cap32 -a ’@/tmp/cmd.txt’
+-c, --cfg_file=FILE
diff --git a/doc/man6/cap32.6 b/doc/man6/cap32.6 index f22c9ce6..3de3c769 100644 --- a/doc/man6/cap32.6 +++ b/doc/man6/cap32.6 @@ -112,8 +112,11 @@ If the mapping file is not defined or not found, Caprice32 will default to a sta .SH OPTIONS .PP .TP -\fB\-a\fR, \fB\-\-autocmd\fR=\fICOMMAND\fR +\fB\-a\fR, \fB\-\-autocmd\fR=\fICOMMAND\fR | \fI@FILENAME\fR pass command to execute to the emulator. The option can be repeated to pass multiple commands. For example: cap32 -a 'print "Hello"' -a 'print "World"' +.RS +with prefix "@", a filename is specified. All commands in the file are passed. For example: cap32 -a '@/tmp/cmd.txt' +.RE .TP \fB\-c\fR, \fB\-\-cfg_file\fR=\fIFILE\fR use FILE as the emulator configuration file. diff --git a/src/argparse.cpp b/src/argparse.cpp index ceb23c63..2ebda3c1 100644 --- a/src/argparse.cpp +++ b/src/argparse.cpp @@ -94,6 +94,12 @@ std::string replaceCap32Keys(std::string command) return command; } +void inlineString(CapriceArgs& args, char* data) +{ + args.autocmd += replaceCap32Keys(data); + args.autocmd += "\n"; +} + void parseArguments(int argc, char **argv, std::vector