summaryrefslogtreecommitdiff
path: root/src/cli
Commit message (Collapse)AuthorAgeFilesLines
* cli: support checkout branch in cloneethomson/cli_cmd_cloneEdward Thomson2022-02-261-10/+14
|
* cli: add checkout branch to cloneEdward Thomson2022-02-261-0/+2
|
* cli: support bare clonesEdward Thomson2022-02-261-5/+16
|
* cli: add an interrupt handler on cloneEdward Thomson2022-02-261-0/+9
|
* cli: show progress during cloneEdward Thomson2022-02-263-2/+461
|
* cli: add a clone commandEdward Thomson2022-02-263-0/+124
|
* cli: don't show `--` literal in helpEdward Thomson2022-02-261-2/+4
|
* cli: provide die macros for ease of exitingEdward Thomson2022-02-261-0/+7
|
* cli: add `hash-object` commandEdward Thomson2022-02-263-2/+139
| | | | Introduce a simple command that emulates `git hash-object`.
* cli: add `cat-file` commandEdward Thomson2022-02-263-1/+207
| | | | Introduce a simple command that emulates `git cat-file`.
* cli: support `help <command>`Edward Thomson2022-02-263-10/+34
| | | | | | Support `help <command>` by re-invoking the command itself with the `--help` argument. This allows us to keep the help logic with the commands itself.
* cli: introduce a help commandEdward Thomson2022-02-265-5/+193
| | | | | | | Add a framework for commands to be defined, and add our first one, "help". When `git2_cli help` is run, the `cmd_help` function will be invoked with the remaining command line arguments. This allows users to invoke `git2_cli help foo` to get information about the `foo` subcommand.
* opt: use a custom function to print usageEdward Thomson2022-02-266-97/+233
| | | | | | | Our argument parser (https://github.com/ethomson/adopt) includes a function to print a usage message based on the allowed options. Omit this and use a cutom function that understands that we have subcommands ("checkout", "revert", etc) that each have their own options.
* cli: infrastructure for a cli projectEdward Thomson2022-02-269-0/+1292
Introduce a command-line interface for libgit2. The goal is for it to be git-compatible. 1. The libgit2 developers can more easily dogfood libgit2 to find bugs, and performance issues. 2. There is growing usage of libgit2's examples as a client; libgit2's examples should be exactly that - simple code samples that illustrate libgit2's usage. This satisfies that need directly. 3. By producing a client ourselves, we can better understand the needs of client creators, possibly producing a shared "middleware" for commonly-used pieces of client functionality like interacting with external tools. 4. Since git is the reference implementation, we may be able to benefit from git's unit tests, running their test suite against our CLI to ensure correct behavior. This commit introduces a simple infrastructure for the CLI. The CLI is currently links libgit2 statically; this is because the utility layer is required for libgit2 _but_ shares the error state handling with libgit2 itself. There's no obviously good solution here without introducing annoying indirection or more complexity. Until we can untangle that dependency, this is a good step forward. In the meantime, we link the libgit2 object files, but we do not include the (private) libgit2 headers. This constrains the CLI to the public libgit2 interfaces.