Skip to content

Instantly share code, notes, and snippets.

@ludomikula
Created September 26, 2019 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ludomikula/2dd6fc57c689f1cb7412eacc45d27ea6 to your computer and use it in GitHub Desktop.
Save ludomikula/2dd6fc57c689f1cb7412eacc45d27ea6 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <string.h>
#include "librestic_amd64.h"
int main(int argc, const char **argv)
{
if (argc < 2 || argv == NULL)
{
fprintf(stderr, "No subcommand supplied!\n");
return false;
}
GoString *args = new GoString[argc -1];
for (int i=1; i < argc; i++)
args[i-1] = { argv[i], (ptrdiff_t)strlen(argv[i]) };
GoSlice resticArgs = { args, argc -1, argc -1 };
int result = run(resticArgs);
delete[] args;
return (result != 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment