2019-01-25 04:03:30 +01:00
|
|
|
= compilescript(1)
|
2019-04-12 19:43:23 +02:00
|
|
|
:doctype: manpage
|
2019-01-25 04:03:30 +01:00
|
|
|
:Author: tastytea
|
|
|
|
:Email: tastytea@tastytea.de
|
2019-04-13 04:22:25 +02:00
|
|
|
:Date: 2019-04-13
|
2019-01-25 04:03:30 +01:00
|
|
|
:Revision: 0.0.0
|
|
|
|
:man source: compilescript
|
|
|
|
:man version: {revision}
|
|
|
|
:man manual: General Commands Manual
|
|
|
|
|
|
|
|
== NAME
|
|
|
|
|
|
|
|
compilescript - allows you to execute files from compiled languages as scripts.
|
|
|
|
|
|
|
|
== SYNOPSIS
|
|
|
|
|
2019-03-05 22:47:22 +01:00
|
|
|
*compilescript* [_file_|_--cleanup_|_--version_] [_arguments_]
|
2019-01-25 04:03:30 +01:00
|
|
|
|
|
|
|
== DESCRIPTION
|
|
|
|
|
|
|
|
compilescript allows you to execute files from compiled languages as scripts.
|
|
|
|
By default it uses g++.
|
|
|
|
|
|
|
|
It compiles the source file, stores the binary in
|
|
|
|
`${XDG_CACHE_HOME}/compilescript/` and executes it. If the binary in cache is
|
|
|
|
newer than the source file, the compilation is skipped.
|
|
|
|
|
|
|
|
Use `#!/usr/bin/env compilescript` as shebang and write the compiler arguments
|
|
|
|
in the second line with the prefix: `//compilescript:`.
|
|
|
|
|
|
|
|
The configuration file is in `${XDG_CONFIG_HOME}/compilescript.cfg`. It will be
|
|
|
|
generated on first run.
|
|
|
|
|
2019-03-05 22:10:08 +01:00
|
|
|
The compiler invocation looks like this: <configured compiler> <source file>
|
|
|
|
<compiler arguments> -o <binary>.
|
|
|
|
|
2019-01-25 04:03:30 +01:00
|
|
|
== OPTIONS
|
|
|
|
|
2019-04-12 19:43:23 +02:00
|
|
|
*--cleanup*::
|
2019-04-13 04:22:25 +02:00
|
|
|
Delete old cache files. You can configure the timespan after which a file is
|
|
|
|
considered old with the config option _clean_after_hours_.
|
2019-04-12 19:43:23 +02:00
|
|
|
|
|
|
|
*--version*::
|
|
|
|
Print version, copyright and license.
|
2019-01-25 04:03:30 +01:00
|
|
|
|
2019-01-25 04:22:08 +01:00
|
|
|
== EXAMPLES
|
2019-01-25 04:03:30 +01:00
|
|
|
|
|
|
|
=== Example script
|
|
|
|
|
|
|
|
[source,cpp]
|
|
|
|
----
|
|
|
|
#!/usr/bin/env compilescript
|
|
|
|
//compilescript: -Wall -pedantic -Wextra
|
|
|
|
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
using std::cout;
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
cout << "Hello world!\n";
|
|
|
|
cout << argv[1] << '\n';
|
|
|
|
}
|
|
|
|
----
|
|
|
|
|
|
|
|
=== Example config
|
|
|
|
|
|
|
|
[source,conf]
|
|
|
|
----
|
2019-02-09 00:20:05 +01:00
|
|
|
compiler = "g++ -x c++";
|
2019-01-25 04:03:30 +01:00
|
|
|
clean_after_hours = 720;
|
|
|
|
cache_dir = "/home/user/.cache/compilescript";
|
|
|
|
----
|
|
|
|
|
|
|
|
== FILES
|
|
|
|
|
2019-04-12 19:43:23 +02:00
|
|
|
- *Configuration file*: `${XDG_CONFIG_HOME}/compilescript.cfg`
|
|
|
|
- *Cache*: `${XDG_CACHE_HOME}/compilescript/`
|
2019-01-25 04:03:30 +01:00
|
|
|
|
2019-01-25 04:49:09 +01:00
|
|
|
`${XDG_CONFIG_HOME}` is usually `~/.config` and `${XDG_CACHE_HOME}` is usually
|
2019-03-05 22:10:08 +01:00
|
|
|
`~/.cache`.
|
2019-01-25 04:03:30 +01:00
|
|
|
|
|
|
|
== REPORTING BUGS
|
|
|
|
|
|
|
|
Bugtracker: https://schlomp.space/tastytea/compilescript/issues
|
2019-01-26 08:23:13 +01:00
|
|
|
|
|
|
|
E-mail: tastytea@tastytea.de
|