Age | Commit message (Collapse) | Author |
|
Remove old process code and comments.
|
|
Config::get():
Change `args` type so we can pass both a `Vec<String>` and
`Vec<&String>`.
diff_options.parse():
* Split diff arguments and program arguments by returning a tuple.
* Exit the args loop once we've parsed an argument.
* Update test
* Add a non-working test for suggestion arguments. An `OPT_OPTIONS`
argument could be followed by an argument that's not the value of the
`OPT_OPTIONS` option. Currently, that arg will always be parsed as the
value. We need to handle this case.
|
|
|
|
Allow getting the program version from the command line.
|
|
Light documentation for our various functions and types.
|
|
Since this check for suggestion arguments is in both binaries, we can
move it to the common preflight function.
Clean up other areas now that we moved the function.
|
|
|
|
|
|
Print usage on `-h` and `--help`.
Store the usage brief on `Config` in order to be able to print it from
multiple places.
|
|
Add `Options` to `Config` to allow us to get a usage string from a
`Config` instance, which is where we create `Options`.
Needed to remove the `Debug` derive on `Config` in order to add the
field as `Options` doesn't implement `Debug`.
|
|
This was a test, before I worked out the API for this function.
|
|
The source error's message doesn't include the name. Ensure we print the
name of the variable we're trying to get so that users know which one is
missing.
|
|
Ensure the source error is surfaced.
|
|
We want to allow not having a remote when URL arguments are given, but
require it when a suggestion ID argument is given (otherwise we wouldn't
have an owner-repo pair to make the GitHub request).
Had some trouble with the `OwnerRepo.o_r` value. It was being moved into
the closure, so tried a loop. There was a similar problem with the loop.
However, by returning, I was able to get a reference to the `Result`
instead of having it be moved.
|
|
Store the suggestion references specified on the command line.
|
|
|
|
Improve organisation.
|
|
We need the following values in order to build a `Client`:
* GitHub token
* Repo owner
* Repo name
Get the token from a command-line argument, or else the Git config, or
else an environment variable.
Get the repo identifiers from the repo's remote URL. Use the remote
specified as a command-line argument, otherwise get it from the Git
config, or else default to "origin".
TODO: Only try to get the owner-name pair from the remote if a comment
ID was given, not if a URL argument was passed.
|