Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cache: emit list of supported GitHub v3 API resource paths #72

Open
salewski opened this issue Apr 10, 2021 · 0 comments
Open

cache: emit list of supported GitHub v3 API resource paths #72

salewski opened this issue Apr 10, 2021 · 0 comments

Comments

@salewski
Copy link
Owner

This issue applies to the ads-github-cache program as shipped with ads-github-tools-0.3.3.

The ads-github-cache program supports many invocations that accept one or more URL_OR_PATH parameters:

    $ ads-github-cache --help
    usage: ads-github-cache { -h | --help }
      or:  ads-github-cache { -V | --version }
      or:  ads-github-cache [OPTION...] --update [--] [URL_OR_PATH...]
      or:  ads-github-cache [OPTION...] { --get | --get-cached } [--] URL_OR_PATH
      or:  ads-github-cache [OPTION...] --clear  [--] [URL_OR_PATH...]
      or:  ads-github-cache [OPTION...] --clear-all

    Manage a user-specific cache of GitHub v3 API responses.

    Mandatory arguments to long options are mandatory for short options too.

      -h, --help        Print this help message on stdout
      -V, --version     Print the version of the program on stdout
          --clear       Remove the specified URLs or paths from the cache
          --clear-all   Remove all cached entries, for all cached URLs or paths
          --get         Obtain content of specfied URL or path through the cache
          --get-cached  Like '--get', but error out if item is not already present in cache.
                          Avoids updating the cache to obtain the item. Think "offline".
          --update      Update the cache entry for the specified URLs or paths, or all
      -v, --verbose     Print program progress messages on stderr. Specify multiple
                          times to increase verbosity: info, debug, and tracing (set -x)
          --            Signals the end of options and disables further options processing.
                          Any remaining argument(s) will be interpretted as a repo name

    Report bugs to Alan D. Salewski <[email protected]>.

As documented in ads-github-cache(1), two equivalent examples of using such parameters are:

    $ ads-github-cache --get '/user/repos'

and:

    $ ads-github-cache --get 'https://api.github.com/user/repos

Both of the above forms require that the user be familiar not only with the "resource path" strucutre of the GitHub v3 API, but also know which particular resource paths are supported by the ads-github-cache program. While the list of supported paths are documented in ads-github-cache(1), it would be handy (for ad hoc command line usage) if there were a way to get the tool to emit the list of supported resource paths. Maybe something like:

    $ ads-github-cache --list-resource-paths

or maybe:

    $ ads-github-cache --list-gh-api-resource-paths

Such a feature would make it easier for the user to map a rough idea of the data wanted (e.g., "my repo names") with the specific resource path construction necessary to obtain the data ("/user/repos").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant