I have my own C project on github. I want to add long-option support by using GNU getopt_long()
(which has it's own git repository). I believe there are 4 ways I can do this:
- Use a git submodule.
- Use a git subtree.
- Import the source of the current (2.22.6) snapshot into my own git repository.
- Import only the
getopt_long()
source files ofgetopt.c
,getopt1.c
, andgnugetopt.h
.
The advantage of 1 and 2 is that I track getopt_long()
. The advantages of 3 and 4 are that if the git repository of getopt_long()
moves, it wont break my repository and it's much simpler to do.
Is there a recommended "GNU way" to do this?