Skip to content

stephenmathieson/expand-braces.c

Repository files navigation

expand-braces

Simple shell-like brace expansion.

Example

#include <stdlib.h>
#include <stdio.h>
#include "expand-braces.h"

int
main(void) {
  char *str = "hello {world,friends,jerks}!";
  char **greetings = NULL;
  int greeting_count = expand_braces(&greetings, str);
  for (int i = 0; i < greeting_count; i++) {
    printf("%s\n", greetings[i]);
    free(greetings[i]);
  }
  free(greetings);
  return 0;
}

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published